Class graph
Directed graph data structure.
Methods
| graph:count () | Gets the number of nodes and number of edges in graph. |
| graph:new ([n=0]) | Creates a new graph. |
Metamethods
| graph:__gc () | Destroys graph. |
Methods
- graph:count ()
-
Gets the number of nodes and number of edges in graph.
Returns:
-
|V| and |E|
- graph:new ([n=0])
-
Creates a new graph.
Parameters:
- n int initial number of nodes (default 0)
Returns:
-
the resulting graph
Or
nilplus error message