|
mcb LEDA Extension Package
0.8
|
Algorithms for directed MCB. More...
#include <LEP/mcb/config.h>#include <LEDA/graph.h>#include <LEDA/array.h>#include <LEDA/edge_array.h>#include <LEDA/integer.h>#include <LEDA/random_source.h>#include <LEP/mcb/edge_num.h>#include <LEP/mcb/fp.h>#include <LEP/mcb/spvecfp.h>#include <LEP/mcb/arithm.h>#include <LEP/mcb/transform.h>#include <LEP/mcb/dsigned.h>

Go to the source code of this file.
Namespaces | |
| mcb | |
| The main package namespace. | |
Functions | |
Directed Minimum Cycle Basis | |
| template<class W > | |
| W | mcb::DMCB (const graph &g, const edge_array< W > &len, array< mcb::spvecfp > &mcb, array< mcb::spvecfp > &proof, const mcb::edge_num &enumb, ptype &p) |
| template<class W > | |
| W | mcb::DMCB (const graph &g, const edge_array< W > &len, array< mcb::spvecfp > &mcb, array< mcb::spvecfp > &proof, const mcb::edge_num &enumb, double error=0.375) |
| Compute a minimum cycle basis of a weighted directed graph. More... | |
| template<class W > | |
| W | mcb::DMCB (const graph &g, const edge_array< W > &len, array< mcb::spvecfp > &mcb, const mcb::edge_num &enumb, double error=0.375) |
| Compute a minimum cycle basis of a weighted directed graph. More... | |
| template<class W > | |
| W | mcb::DMCB (const graph &g, const edge_array< W > &len, array< array< etype > > &mcb, const mcb::edge_num &enumb, double error=0.375) |
| Compute a minimum cycle basis of a weighted directed graph. More... | |
Algorithms for directed MCB.
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 two 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.
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.
1.8.11