Expand description
Path-related algorithms. Phase 1 entries: ALGO-SP-006 (unweighted single-source distances), ALGO-CC-040 (Eulerian path / cycle existence), ALGO-CC-041 (Eulerian path/cycle construction, undirected), ALGO-SP-020 (eccentricity / radius / diameter).
Structs§
- Dijkstra
AllPaths - Output of
dijkstra_all_shortest_paths. - Dijkstra
Paths - Output of
dijkstra_paths.parents[v]is the predecessor ofvalong the shortest-path tree from the single source (orNonefor the source itself and for unreachable vertices — the caller can disambiguate viadistances[v]).inbound_edges[v]is the edge idvwas reached through;Nonefor the source and unreachable vertices. - Eulerian
Classification - Whether an Eulerian path or cycle exists in a graph.
Enums§
- Dijkstra
Mode - Direction selector for the mode-aware Dijkstra entry points
(SP-001c). Counterpart of
igraph_neimode_trestricted to the three valuesigraph_distances_dijkstraaccepts. For undirected graphs every variant collapses toDijkstraMode::All(every edge is bidirectional).
Functions§
- a_
star_ path - Single-source single-target shortest path using A*.
- diameter
- Diameter of
graph— the maximum vertex eccentricity.Nonefor a graph with no vertices. - diameter_
weighted - OUT-mode default for
diameter_weighted_with_mode. - diameter_
weighted_ with_ mode - Mode-aware weighted diameter.
Noneforvcount == 0. - dijkstra_
all_ shortest_ paths - All shortest weighted paths from
sourceto every vertex, preserving every tie. Counterpart ofigraph_get_all_shortest_paths_dijkstra(_, _, _, _, source, vss_all(), weights, mode). - dijkstra_
distances - Single-source Dijkstra distances.
- dijkstra_
distances_ cutoff - Single-source Dijkstra distances with an optional
cutoff. Whencutoff = Some(c), vertices whose shortest-path distance exceedscare returned asNone(unreachable-within-cutoff); the search stops relaxing edges out of any vertex whosemindist > c. - dijkstra_
distances_ cutoff_ with_ mode - Mode-aware
dijkstra_distances_cutoff. Counterpart ofigraph_distances_dijkstra_cutoff(_, _, source, vss_all(), weights, mode, cutoff). - dijkstra_
distances_ multi - Multi-source Dijkstra distances.
result[i][v]is the shortest distance fromsources[i]tov(orNoneif unreachable / past the cutoff). - dijkstra_
distances_ multi_ with_ mode - Mode-aware
dijkstra_distances_multi. - dijkstra_
distances_ with_ mode - Mode-aware Dijkstra distances. Counterpart of
igraph_distances_dijkstra(_, _, source, vss_all(), weights, mode). - dijkstra_
path_ to - Reconstruct a single source-to-target path returning vertex and
edge sequences.
Ok(None)iftargetis unreachable; the source vertex appears as the first element when reachable. - dijkstra_
path_ to_ with_ mode - Mode-aware
dijkstra_path_to. Counterpart ofigraph_get_shortest_path_dijkstra(_, _, _, source, target, weights, mode). - dijkstra_
paths - Single-source Dijkstra returning distances + parents + inbound edges over every vertex.
- dijkstra_
paths_ with_ mode - Mode-aware
dijkstra_paths. Counterpart ofigraph_get_shortest_paths_dijkstra(_, _, _, source, vss_all(), weights, mode, parents, inbound_edges). - distances
- Unweighted shortest-path lengths from
sourceto every vertex. - eccentricity
- Eccentricity of every vertex (length
vcount). Resultr[v]is the maximum shortest-path distance fromvto any reachable vertex. Isolated vertices have eccentricity0. - eccentricity_
weighted - OUT-mode default for
eccentricity_weighted_with_mode. Counterpart ofigraph_eccentricity(_, weights, _, igraph_vss_all(), IGRAPH_OUT). - eccentricity_
weighted_ with_ mode - Mode-aware weighted eccentricity. For each vertex
v, returnsmax_{u reachable from v} dist(v, u), where distances are weighted shortest-path lengths (Dijkstra). Unreachable vertex pairs are ignored (matches upstream’sunconn=true); isolated vertices have eccentricity0.0. - eulerian_
path - Build an Eulerian path or cycle for
graphif one exists. ReturnsSome(edge_ids)(the walk visits each edge exactly once) orNoneif no Eulerian walk exists. - floyd_
warshall_ distances - All-pairs shortest distances via Floyd-Warshall.
- is_
eulerian - Decide whether
graphhas an Eulerian path and/or cycle. - radius
- Radius of
graph— the minimum vertex eccentricity.Nonefor a graph with no vertices (matches upstream’sIGRAPH_NANfor the null graph). - radius_
weighted - OUT-mode default for
radius_weighted_with_mode. - radius_
weighted_ with_ mode - Mode-aware weighted radius.
Noneforvcount == 0. - random_
walk - Random walk on
graphstarting atstart, taking up tostepstransitions.