MixedGraph.mixedUnorientedPath

MixedGraph.mixedUnorientedPath(node1, node2)
Parameters:
  • node1 (int) – the id from which the path begins

  • node2 (int) – the id to which the path ends

Returns:

a path from node1 to node2, using edges and/or arcs (not necessarily following the direction of the arcs), or None if no path exists.

Return type:

list[int] or None

Example

import pyagrum as gum

g = gum.fastMixedGraph("A->B-C;D->C")
g.mixedUnorientedPath(0, 3)  # the arcs are followed in any direction
# [0, 1, 2, 3]

Class

MixedGraph

Overridden in

PDAG.mixedUnorientedPath