DiGraph.hasDirectedPath
- DiGraph.hasDirectedPath(_from, to)
Check if a directedpath exists between from and to.
- Parameters:
from (
int) – the id of the first node of the (possible) pathto (
int) – the id of the last node of the (possible) path_from (
int)
- Returns:
True if the directed path exists
- Return type:
bool
Example
import pyagrum as gum
g = gum.fastDiGraph("A->B->C")
g.hasDirectedPath(0, 2)
# True
g.hasDirectedPath(2, 0)
# False
Used by
DiGraph, ChainGraph, DAG, MixedGraph, PDAG
