DiGraph.addNodes

DiGraph.addNodes(n)

Add a set of n nodes.

Parameters:

n (int) – the number of nodes to add.

Returns:

the new ids

Return type:

Set of int

Example

import pyagrum as gum

g = gum.DiGraph()
g.addNodes(3)
# {0, 1, 2}
g.size()
# 3

Class

DiGraph

Overridden in

DAG.addNodes, MixedGraph.addNodes, PDAG.addNodes