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

Detailed Description

This is a simple and fast directed full graph implementation. From each node go arcs to each node (including the source node), therefore the number of the arcs in the digraph is the square of the node number. This digraph type is completely static, so you can neither add nor delete either arcs or nodes, and it needs constant space in memory.

This class fully conforms to the Digraph concept.

The FullDigraph and FullGraph classes are very similar, but there are two differences. While this class conforms only to the Digraph concept, the FullGraph class conforms to the Graph concept, moreover FullGraph does not contain a loop arc for each node as FullDigraph does.

See Also
FullGraph

#include <lemon/full_graph.h>

Inherits DigraphExtender< Base >.

Public Member Functions

 FullDigraph ()
 Constructor.
 
 FullDigraph (int n)
 Constructor.
 
void resize (int n)
 Resizes the digraph.
 
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 &u, const Node &v) const
 
int nodeNum () const
 Number of nodes.
 
int arcNum () const
 Number of arcs.
 

Constructor & Destructor Documentation

FullDigraph ( int  n)
inline

Constructor.

Parameters
nThe number of the nodes.

Member Function Documentation

void resize ( int  n)
inline

Resizes the digraph. The function will fully destroy and rebuild the digraph. This cause that the maps of the digraph will reallocated automatically and the previous values will be lost.

Node operator() ( int  ix) const
inline

Returns the node with the given index. Since it is a static digraph its nodes can be indexed with integers from the range [0..nodeNum()-1].

See Also
index()
int index ( const Node &  node) const
inline

Returns the index of the given node. Since it is a static digraph its nodes can be indexed with integers from the range [0..nodeNum()-1].

See Also
operator()
Arc arc ( const Node &  u,
const Node &  v 
) const
inline

Returns the arc connecting the given nodes.