InfluenceDiagram.topologicalOrder

InfluenceDiagram.topologicalOrder()
Returns:

the list of the nodes Ids in a topological order

Return type:

List

Raises:

pyagrum.InvalidDirectedCycle – If this graph contains cycles

Example

import pyagrum as gum

diag = gum.fastID("C->*D->$U<-C")
[diag.variable(i).name() for i in diag.topologicalOrder()]
# ['C', 'D', 'U']

Class

InfluenceDiagram