FullBpGraph is a simple and fast implmenetation of undirected full bipartite graphs. It contains an edge between every red-blue pairs of nodes, therefore the number of edges is nr*nb
. This class is completely static and it needs constant memory space. Thus you can neither add nor delete nodes or edges, however the structure can be resized using resize().
This type fully conforms to the BpGraph concept. Most of its member functions and nested classes are documented only in the concept class.
This class provides constant time counting for nodes, edges and arcs.
#include <lemon/full_graph.h>
Inherits BpGraphExtender< Base >.
Public Member Functions | |
FullBpGraph () | |
Default constructor. More... | |
FullBpGraph (int redNum, int blueNum) | |
Constructor. More... | |
void | resize (int redNum, int blueNum) |
Resizes the graph. More... | |
RedNode | redNode (int index) const |
Returns the red node with the given index. More... | |
int | index (RedNode node) const |
Returns the index of the given red node. More... | |
BlueNode | blueNode (int index) const |
Returns the blue node with the given index. More... | |
int | index (BlueNode node) const |
Returns the index of the given blue node. More... | |
Edge | edge (const Node &u, const Node &v) const |
Returns the edge which connects the given nodes. More... | |
Arc | arc (const Node &u, const Node &v) const |
Returns the arc which connects the given nodes. More... | |
int | nodeNum () const |
Number of nodes. | |
int | redNum () const |
Number of red nodes. | |
int | blueNum () const |
Number of blue nodes. | |
int | arcNum () const |
Number of arcs. | |
int | edgeNum () const |
Number of edges. | |
|
inline |
Default constructor. The number of nodes and edges will be zero.
|
inline |
Constructor.
redNum | The number of the red nodes. |
blueNum | The number of the blue nodes. |
|
inline |
This function resizes the graph. It fully destroys and rebuilds the structure, therefore the maps of the graph will be reallocated automatically and the previous values will be lost.
|
inline |
Returns the red node with the given index. Since this structure is completely static, the red nodes can be indexed with integers from the range [0..redNum()-1]
.
|
inline |
Returns the index of the given red node. Since this structure is completely static, the red nodes can be indexed with integers from the range [0..redNum()-1]
.
|
inline |
Returns the blue node with the given index. Since this structure is completely static, the blue nodes can be indexed with integers from the range [0..blueNum()-1]
.
|
inline |
Returns the index of the given blue node. Since this structure is completely static, the blue nodes can be indexed with integers from the range [0..blueNum()-1]
.
|
inline |
Returns the edge which connects the given nodes.
|
inline |
Returns the arc which connects the given nodes.