graph.mixedOrientedPath
- pyagrum.graph.mixedOrientedPath(g, source, target)
A shortest path made of arcs (followed in their direction) and edges between two nodes (family AE).
- Parameters:
g (
MixedGraph | PDAG | ChainGraph | CPDAG | MPDAG | EssentialGraph) – the graphsource (
int | str) – the first node of the pathtarget (
int | str) – the last node of the path
- Returns:
the nodes of the path, from
sourcetotarget, or None if there is no such path- Return type:
list[int] | None
Example
import pyagrum as gum
import pyagrum.graph as gg
g = gum.fastPDAG("A->B-C")
gg.mixedOrientedPath(g, "A", "C")
# [0, 1, 2]
print(gg.mixedOrientedPath(g, "C", "A"))
# None