Loading...
Searching...
No Matches
FullBpGraph Class Reference
Data Structures » Graph Structures

## 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>`

## 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
| Returns the edge which connects the given nodes.
Arc | arc (const Node &u, const Node &v) const
| Returns the arc which connects the given nodes.
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() [1/2]

FullBpGraph | ( |  | ) |

inline

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

## FullBpGraph() [2/2]

FullBpGraph | ( | int | redNum,
|  | int | blueNum )

inline

Constructor.

Parameters

  redNum | The number of the red nodes.
  blueNum | The number of the blue nodes.

## Member Function Documentation

## resize()

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 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()

## index() [1/2]

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 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()

## index() [2/2]

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 edge | ( | const Node & | u,
|  | const Node & | v ) const

inline

Returns the edge which connects the given nodes.

## arc()

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

inline

Returns the arc which connects the given nodes.