This is a simple and fast undirected full graph implementation. From each node go edge to each other node, therefore the number of edges in the graph is . This graph type is completely static, so you can neither add nor delete either edges or nodes, and it needs constant space in memory.
This class fully conforms to the Graph concept.
The FullGraph
and FullDigraph
classes are very similar, but there are two differences. While the FullDigraph
class conforms only to the Digraph concept, this class conforms to the Graph concept, moreover FullGraph
does not contain a loop arc for each node as FullDigraph
does.
#include <lemon/full_graph.h>
Inherits lemon::GraphExtender< FullGraphBase >.
Public Member Functions | |
FullGraph () | |
Constructor. | |
FullGraph (int n) | |
Constructor. | |
void | resize (int n) |
Resizes the graph. | |
Node | operator() (int ix) const |
Returns the node with the given index. | |
int | index (const Node &node) const |
Returns the index of the given node. | |
Arc | arc (const Node &s, const Node &t) const |
Edge | edge (const Node &u, const Node &v) const |
int | nodeNum () const |
Number of nodes. | |
int | arcNum () const |
Number of arcs. | |
int | edgeNum () const |
Number of edges. |
FullGraph | ( | int | n | ) | [inline] |
Constructor.
n | The number of the nodes. |
void resize | ( | int | n | ) | [inline] |
Resizes the graph. The function will fully destroy and rebuild the graph. This cause that the maps of the graph will reallocated automatically and the previous values will be lost.
Node operator() | ( | int | ix | ) | const [inline] |
int index | ( | const Node & | node | ) | const [inline] |
Returns the index of the given node. Since it is a static graph its nodes can be indexed with integers from the range [0..nodeNum()-1]
.
Arc arc | ( | const Node & | s, |
const Node & | t | ||
) | const [inline] |
Returns the arc connecting the given nodes.
Edge edge | ( | const Node & | u, |
const Node & | v | ||
) | const [inline] |
Returns the edge connects the given nodes.