0

Here is an example of graph initialization from Lemon Tutorial:

ListDigraph g;
ListDigraph::Node x = g.addNode();
ListDigraph::Node y = g.addNode();
ListDigraph::Node z = g.addNode();
g.addArc(x,y);
g.addArc(y,z);
g.addArc(z,x);

Can the same be accomplished by using a container with arc data? For example:

vector<pair<int, int>> arcs = {{0, 1}, {1, 2}, {2, 0}};
LemonGraph             g(3, arcs);

EDIT

I just found that it can be done for StaticDigraph, see below:

vector<pair<int, int>> arcs = {{0, 1}, {1, 2}, {2, 0}};
StaticDigraph          g;

g.build(3, arcs.begin(), arcs.end());

Can StaticDigraph be easily transformed to modifiable type of graph?

Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72

1 Answers1

1

No, there is only one constructor, that is default. docs

ForEveR
  • 55,233
  • 2
  • 119
  • 133