dim
binary length. Two nodes are connected in the graph if the indices differ only on one position in the binary form.
ids
is chosen to int
because efficiency reasons. This way the maximal dimension of this implementation is 26.
#include <lemon/hypercube_graph.h>
Classes | |
class | HyperMap |
Linear combination map. More... | |
Public Member Functions | |
HyperCubeGraph (int dim) | |
int | dimension () const |
bool | projection (Node node, int n) const |
int | dimension (Edge edge) const |
The dimension id of the edge. | |
int | index (Node node) const |
Gives back the index of the node. | |
Node | operator() (int ix) const |
int | nodeNum () const |
Number of nodes. | |
int | edgeNum () const |
Number of edges. |
HyperCubeGraph | ( | int | dim | ) | [inline] |
Construct a graph with dim
dimension.
int dimension | ( | ) | const [inline] |
Gives back the number of the dimensions.
bool projection | ( | Node | node, | |
int | n | |||
) | const [inline] |
Returns true if the n'th bit of the node is one.
int dimension | ( | Edge | edge | ) | const [inline] |
It returns the dimension id of the edge. It can be in the intervall.
int index | ( | Node | node | ) | const [inline] |
Gives back the index of the node. The lower bits of the integer describes the node.
Node operator() | ( | int | ix | ) | const [inline] |
Gives back the node by its index.