all_toposorts: Extract all possible toposorts of a graph

View source: R/graph.R

all_toposortsR Documentation

Extract all possible toposorts of a graph

Description

Some toporanga graphs can be topologically sorted in many ways, but arrange will generate only one, random order. This function allows to list all of them. Use sample_toposort to fairly sample a single toposort.

Usage

all_toposorts(x, ..., limit = Inf)

Arguments

x

a toporanga_graph object.

...

ignored.

limit

maximal number of permutations returned; function errors when exhausted.

Value

A list of possible orderings, in a form of vectors of agent IDs.


toporanga documentation built on Aug. 8, 2025, 6:15 p.m.