dasi.utils.networkx.shortest_path

Functions

multipoint_shortest_path(graph, nodes, …)

Return shortest path through nodes.

sympy_dijkstras(g, source, f[, target, …])

Computes the shortest path distance and path for a graph using an arbitrary function.

sympy_multipoint_shortest_path(graph, nodes, …)

sympy_multisource_dijkstras(g, sources, f[, …])

Functions

multipoint_shortest_path(graph, nodes, …)

Return shortest path through nodes.

sympy_dijkstras(g, source, f[, target, …])

Computes the shortest path distance and path for a graph using an arbitrary function.

dasi.utils.networkx.shortest_path.multipoint_shortest_path(graph, nodes, weight_key, cyclic=False, cyclic_sort_key=None)[source]

Return shortest path through nodes. If cyclic, will return the cycle sorted with the ‘lowest’ node at index 0. Self cycles are not supported.

Parameters
  • graph (DiGraph) – the graph

  • nodes (List[str]) – list of nodes to find path

  • weight_key (str) – weight key

  • cyclic – whether the path is cyclic

  • cyclic_sort_key – the key function to use to sort the cycle (if cyclic)

Returns

dasi.utils.networkx.shortest_path.sympy_dijkstras(g, source, f, target=None, accumulators=None, init=None, cutoff=None)[source]

Computes the shortest path distance and path for a graph using an arbitrary function.

Parameters
  • g

  • source

  • f

  • target

  • accumulators

  • init

  • cutoff

Returns