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

Detailed Description

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 $n(n-1)/2$. 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.

See Also
FullDigraph

#include <lemon/full_graph.h>

Inherits GraphExtender< Base >.

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.
 

Constructor & Destructor Documentation

FullGraph ( int  n)
inline

Constructor.

Parameters
nThe number of the nodes.

Member Function Documentation

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

Returns the node with the given index. Since it is a static graph 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 graph its nodes can be indexed with integers from the range [0..nodeNum()-1].

See Also
operator()
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.