Given an directed graph
and a positive length function on the edges
, a minimum cycle basis is a set of cycles which can generate the cycle space and at the same time has minimum total length.
Each cycle of the graph is assumed to be a vector in
indexed on the edge set, and operations between cycles is performed in
. The length of a cycle basis is the sum of the length of its cycles and the length of a cycle is the sum of the length of its edges.
Most functions of this section are templates functions. The template parameter W denoting the type of the edge weights can be instantiated with any number type. Attention must be paid in order to avoid overflow of values.
The solution of a minimum cycle basis problem can be in the following three forms.
and the second is in case of mcb a value of
where positive is an arbitrary direction of traversing the cycle and in case of proof a value in
for some prime number
. Each index represents an edge.
represents edge
.
of the array is
or
, based on whether the edge
with number
( enumb(e) = i ) belongs to the cycle and if yes in which direction compared with an arbitrary direction of traversing the cycle.The whole package is protected using a namespace called "mcb", and therefore using anything requires mcb::xx or the using namespace mcb directive.
#include <LEDA/graph.h>
#include <LEDA/array.h>
#include <LEDA/edge_array.h>
#include <LEDA/list.h>
#include <LEDA/integer.h>
#include <LEDA/p_queue.h>
#include <LEDA/random_source.h>
#include <LEDA/sortseq.h>
#include <LEDA/tuple.h>
#include <LEP/mcb/edge_num.h>
#include <LEP/mcb/fp.h>
#include <LEP/mcb/arithm.h>
Include dependency graph for dir_min_cycle_basis.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Namespaces | |
| namespace | mcb |
Functions | |
| template<class W> | |
| W | mcb::DIR_MIN_CYCLE_BASIS (const graph &g, const edge_array< W > &len, array< spvecfp > &mcb, array< spvecfp > &proof, const edge_num &enumb, double error=0.375) |
| Compute a minimum cycle basis of a weighted directed graph. | |
| template<class W> | |
| W | mcb::DIR_MIN_CYCLE_BASIS (const graph &g, const edge_array< W > &len, array< array< etype > > &mcb, const edge_num &enumb, double error=0.375) |
| Compute a minimum cycle basis of a weighted directed graph. | |
| template<class W> | |
| W | mcb::DIR_MIN_CYCLE_BASIS (const graph &g, const edge_array< W > &len, array< list< edge > > &mcb, double error=0.375) |
| Compute a minimum cycle basis of a weighted directed graph. | |
1.4.6