All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
FullBpGraph Class Reference

Detailed Description

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.

See Also
FullGraph

#include <lemon/full_graph.h>

Inherits BpGraphExtender< Base >.

Public Member Functions

 FullBpGraph ()
 Default constructor.
 
 FullBpGraph (int redNum, int blueNum)
 Constructor.
 
void resize (int redNum, int blueNum)
 Resizes the graph.
 
RedNode redNode (int index) const
 Returns the red node with the given index.
 
int index (RedNode node) const
 Returns the index of the given red node.
 
BlueNode blueNode (int index) const
 Returns the blue node with the given index.
 
int index (BlueNode node) const
 Returns the index of the given blue node.
 
Edge edge (const Node &u, const Node &v) const
 
Arc arc (const Node &u, const Node &v) const
 
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.
 

Constructor & Destructor Documentation

FullBpGraph ( )
inline

Default constructor. The number of nodes and edges will be zero.

FullBpGraph ( int  redNum,
int  blueNum 
)
inline

Constructor.

Parameters
redNumThe number of the red nodes.
blueNumThe number of the blue nodes.

Member Function Documentation

void resize ( int  redNum,
int  blueNum 
)
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.

RedNode redNode ( int  index) const
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].

See Also
redIndex()
int index ( RedNode  node) const
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].

See Also
operator()()
BlueNode blueNode ( int  index) const
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].

See Also
blueIndex()
int index ( BlueNode  node) const
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].

See Also
operator()()
Edge edge ( const Node &  u,
const Node &  v 
) const
inline

Returns the edge which connects the given nodes.

Arc arc ( const Node &  u,
const Node &  v 
) const
inline

Returns the arc which connects the given nodes.