sample_toposort: Switch default toposorts of a graph to a random one

View source: R/graph.R

sample_toposortR Documentation

Switch default toposorts of a graph to a random one

Description

Some toporanga graphs can be topologically sorted in many ways, but arrange will generate only one, random order. This function allows one to switch it to an another, randomly sampled one. Use all_toposorts to calculate all possible orderings.

Usage

sample_toposort(x)

Arguments

x

a toporanga graph.

Value

The same graph, with a fairly re-sampled default order.


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