NetworkX

Table Of Contents

Previous topic

Operators

Next topic

Traversal

Shortest Paths

Compute the shortest paths and path lengths between nodes in the graph.

These algorithms work with undirected and directed graphs.

For directed graphs the paths can be computed in the reverse order by first flipping the edge orientation using R=G.reverse(copy=False).

Advanced Interface

Shortest path algorithms for unweighted graphs.

Shortest path algorithms for weighed graphs.

A* Algorithm

Shortest paths and path lengths using A* (“A star”) algorithm.