mcb Namespace Reference


Detailed Description

Main namespace of MCB LEDA Extension Package.


Classes

class  edge_num
 An edge numbering class. More...
class  spvecgf2
 A sparse vector with elements in GF2. More...
class  spvecfp
 A sparse vector with elements in $F_p$. More...

Typedefs

typedef long indextype
typedef leda::integer ptype

Functions

template<class W>
MCB (const leda::graph &g, const leda::edge_array< W > &len, leda::array< leda::list< leda::edge > > &mcb, double errorp=0.375)
 Compute a minimum cycle basis of a graph.
int MCB (const graph &g, array< list< edge > > &mcb, double errorp=0.375)
 Compute a minimum cycle basis of an unweighted graph.
std::ostream & operator<< (std::ostream &o, const spvecgf2 &v)
std::istream & operator>> (std::istream &o, spvecgf2 &v)
std::ostream & operator<< (std::ostream &o, const spvecfp &v)
int MIN_CYCLE_BASIS_DEPINA (const leda::graph &g, leda::array< leda::d_int_set > &mcb, leda::array< leda::d_int_set > &proof, const mcb::edge_num &enumb)
 Compute a MCB of an undirected unweighted graph using de Pina's algorithm.
int MIN_CYCLE_BASIS_DEPINA (const leda::graph &g, leda::array< leda::d_int_set > &mcb, const edge_num &enumb)
 Compute a MCB of an undirected unweighted graph using de Pina's algorithm.
int MIN_CYCLE_BASIS_DEPINA (const leda::graph &g, leda::array< mcb::spvecgf2 > &mcb, leda::array< mcb::spvecgf2 > &proof, const edge_num &enumb)
 Compute a MCB of an undirected unweighted graph using de Pina's algorithm.
int MIN_CYCLE_BASIS_DEPINA (const leda::graph &g, leda::array< mcb::spvecgf2 > &mcb, const edge_num &enumb)
 Compute a MCB of an undirected unweighted graph using de Pina's algorithm.
int MIN_CYCLE_BASIS_DEPINA (const leda::graph &g, leda::array< leda::list< leda::edge > > &mcb, leda::array< leda::list< leda::edge > > &proof)
 Compute a MCB of an undirected unweighted graph using de Pina's algorithm.
int MIN_CYCLE_BASIS_DEPINA (const leda::graph &g, leda::array< leda::list< leda::edge > > &mcb)
 Compute a MCB of an undirected unweighted graph using de Pina's algorithm.
int MIN_CYCLE_BASIS_HYBRID (const leda::graph &g, leda::array< leda::d_int_set > &mcb, leda::array< leda::d_int_set > &proof, const edge_num &enumb)
int MIN_CYCLE_BASIS_HYBRID (const leda::graph &g, leda::array< leda::d_int_set > &mcb, const edge_num &enumb)
int MIN_CYCLE_BASIS_HYBRID (const leda::graph &g, leda::array< leda::list< leda::edge > > &mcb, leda::array< leda::list< leda::edge > > &proof)
int MIN_CYCLE_BASIS_HYBRID (const leda::graph &g, leda::array< leda::list< leda::edge > > &mcb)
template<class W>
MIN_CYCLE_BASIS_DEPINA (const graph &g, const edge_array< W > &len, array< spvecgf2 > &mcb, array< spvecgf2 > &proof, const edge_num &enumb)
 Compute a MCB of an undirected weighted graph using de Pina's algorithm.
template<class W>
MIN_CYCLE_BASIS_DEPINA (const graph &g, const edge_array< W > &len, array< d_int_set > &mcb, array< d_int_set > &proof, const edge_num &enumb)
 Compute a MCB of an undirected weighted graph using de Pina's algorithm.
template<class W>
MIN_CYCLE_BASIS_DEPINA (const graph &g, const edge_array< W > &len, array< d_int_set > &mcb, const edge_num &enumb)
 Compute a MCB of an undirected weighted graph using de Pina's algorithm.
template<class W>
MIN_CYCLE_BASIS_DEPINA (const graph &g, const edge_array< W > &len, array< spvecgf2 > &mcb, const edge_num &enumb)
 Compute a MCB of an undirected weighted graph using de Pina's algorithm.
template<class W>
MIN_CYCLE_BASIS_DEPINA (const graph &g, const edge_array< W > &len, array< list< edge > > &mcb)
 Compute a MCB of an undirected weighted graph using de Pina's algorithm.
template<class W>
MIN_CYCLE_BASIS_DEPINA (const graph &g, const edge_array< W > &len, array< list< edge > > &mcb, array< list< edge > > &proof)
 Compute a MCB of an undirected weighted graph using de Pina's algorithm.
template<class W>
MIN_CYCLE_BASIS_HYBRID (const graph &g, const edge_array< W > &len, array< d_int_set > &mcb, array< d_int_set > &proof, const edge_num &enumb)
template<class W>
MIN_CYCLE_BASIS_HYBRID (const graph &g, const edge_array< W > &len, array< d_int_set > &mcb, const edge_num &enumb)
template<class W>
MIN_CYCLE_BASIS_HYBRID (const graph &g, const edge_array< W > &len, array< list< edge > > &mcb, array< list< edge > > &proof)
template<class W>
MIN_CYCLE_BASIS_HYBRID (const graph &g, const edge_array< W > &len, array< list< edge > > &mcb)
template<class W>
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>
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>
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.


Typedef Documentation

typedef long mcb::indextype
 

The index type used for the directed cycle basis algorithm.

typedef leda::integer mcb::ptype
 

The prime type used for the directed cycle basis algorithm.


Function Documentation

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.

The function computes a directed Minimum Cycle Basis $B$ of $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges, called mcb.

Since the algorithm is a randomized Monte-Carlo algorithm, the error argument which should be less that 1 represents the acceptable error probability that the returned cycle basis is not a minimum cycle basis.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.

The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g A directed graph.
len The edge lengths.
mcb A leda::array of spvecfp to return the MCB.
error The error probability.
Precondition:
g is simple and loop-free

len is positive

error is positive and less than one

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.

The function computes a directed Minimum Cycle Basis $B$ of $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of arrays of integers. Each such array if indexed on $1 \dots m$ and its entry can be $0$ or $\pm 1$. Which edge corresponds to which index in this array can be found by the edge numbering, enumb. Note that the edge numbering using an indexing from $0$ to $m-1$.

Since the algorithm is a randomized Monte-Carlo algorithm, the error argument which should be less that 1 represents the acceptable error probability that the returned cycle basis is not a minimum cycle basis.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.

The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g A directed graph.
len The edge lengths.
mcb A leda::array of leda::arrays of ints to return the MCB.
enumb An edge numbering.
error The error probability.
Precondition:
g is simple and loop-free

len is positive

enumb is already initialized with g

error is positive and less than one

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.

The function computes a directed Minimum Cycle Basis $B$ of $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of sparse vectors spvecfp, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with non-zero intersection with the proof vector $i$.

Since the algorithm is a randomized Monte-Carlo algorithm, the error argument which should be less that 1 represents the acceptable error probability that the returned cycle basis is not a minimum cycle basis.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.

The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g A directed graph.
len The edge lengths.
mcb A leda::array of spvecfp to return the MCB.
proof A leda::array of spvecfp to return the proof.
enumb An edge numbering.
error The error probability.
Precondition:
g is simple and loop-free

len is positive

enumb is already initialized with g

error is positive and less than one

int mcb::MCB const graph &  g,
array< list< edge > > &  mcb,
double  errorp = 0.375
 

Compute a minimum cycle basis of an unweighted graph.

The function computes a Minimum Cycle Basis $B$ of $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges, called mcb.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$. If the graph is directed the algorithm is a Monte-Carlo with success probability of returning a minimum cycle basis, $5/8$. The algorithm always returns a basis. If the graph is undirected, the minimum cycle basis is always returned.
The parameter $errorp$ can be used to decrease the error probability to something less than $3/8$, by repeating the algorithm multiple times. It has effect only in the directed case.
The space requirement is linear.

Parameters:
g The graph.
mcb An array of list of edges to store the MCB.
errorp Error parameter, only used in the directed case.
Returns:
The length of the MCB if the MCB was computed successfuly, otherwise undefined.
Precondition:
g is simple and loopfree

errorp is a valid probability larger than zero

template<class W>
W mcb::MCB const leda::graph &  g,
const leda::edge_array< W > &  len,
leda::array< leda::list< leda::edge > > &  mcb,
double  errorp = 0.375
 

Compute a minimum cycle basis of a graph.

The function computes a Minimum Cycle Basis $B$ of $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges, called mcb.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$. If the graph is directed the algorithm is a Monte-Carlo with success probability of returning a minimum cycle basis, $5/8$. The algorithm always returns a basis. If the graph is undirected, the minimum cycle basis is always returned.
The parameter $errorp$ can be used to decrease the error probability to something less than $3/8$, by repeating the algorithm multiple times. It has effect only in the directed case.
The space requirement is linear.

Parameters:
g The graph.
len An edge array with the edge lengths.
mcb An array of list of edges to store the MCB.
errorp Error parameter, only used in the directed case.
Returns:
The length of the MCB if the MCB was computed successfuly, otherwise undefined.
Precondition:
len is non-negative for undirected and positive for directed graphs.

g is simple and loopfree

errorp is a valid probability larger than zero

template<class W>
W mcb::MIN_CYCLE_BASIS_DEPINA const graph &  g,
const edge_array< W > &  len,
array< list< edge > > &  mcb,
array< list< edge > > &  proof
 

Compute a MCB of an undirected weighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array or lists of edges, called mcb.

The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::list of edges to return the MCB.
proof A leda::array of leda::list of edges to return the proof.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

len is non-negative

Remarks:
Care must be taken when the template parameter is instantiated with a data type which has rounding errors.

template<class W>
W mcb::MIN_CYCLE_BASIS_DEPINA const graph &  g,
const edge_array< W > &  len,
array< list< edge > > &  mcb
 

Compute a MCB of an undirected weighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges, called mcb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::list of edges to return the MCB.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

len is non-negative

Remarks:
Care must be taken when the template parameter is instantiated with a data type which has rounding errors.

template<class W>
W mcb::MIN_CYCLE_BASIS_DEPINA const graph &  g,
const edge_array< W > &  len,
array< spvecgf2 > &  mcb,
const edge_num &  enumb
 

Compute a MCB of an undirected weighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of spvecgf2, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of spvecgf2 to return the MCB.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

len is non-negative

Remarks:
Care must be taken when the template parameter is instantiated with a data type which has rounding errors.

template<class W>
W mcb::MIN_CYCLE_BASIS_DEPINA const graph &  g,
const edge_array< W > &  len,
array< d_int_set > &  mcb,
const edge_num &  enumb
 

Compute a MCB of an undirected weighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of LEDA's dynamic integer sets, leda::d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::d_int_set to return the MCB.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

len is non-negative

Remarks:
Care must be taken when the template parameter is instantiated with a data type which has rounding errors.

template<class W>
W mcb::MIN_CYCLE_BASIS_DEPINA const graph &  g,
const edge_array< W > &  len,
array< d_int_set > &  mcb,
array< d_int_set > &  proof,
const edge_num &  enumb
 

Compute a MCB of an undirected weighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of LEDA's dynamic integer sets, leda::d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb. The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::d_int_set to return the MCB.
proof A leda::array of leda::d_int_set to return the proof.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

len is non-negative

Remarks:
Care must be taken when the template parameter is instantiated with a data type which has rounding errors.

template<class W>
W mcb::MIN_CYCLE_BASIS_DEPINA const graph &  g,
const edge_array< W > &  len,
array< spvecgf2 > &  mcb,
array< spvecgf2 > &  proof,
const edge_num &  enumb
 

Compute a MCB of an undirected weighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of sparse vectors, spvecgf2, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb. The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of spvecgf2 to return the MCB.
proof A leda::array of spvecgf2 to return the proof.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

len is non-negative

Remarks:
Care must be taken when the template parameter is instantiated with a data type which has rounding errors.

int mcb::MIN_CYCLE_BASIS_DEPINA const leda::graph &  g,
leda::array< leda::list< leda::edge > > &  mcb
 

Compute a MCB of an undirected unweighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of list of edges called mcb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
mcb A array of list of edges to return the MCB.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

int mcb::MIN_CYCLE_BASIS_DEPINA const leda::graph &  g,
leda::array< leda::list< leda::edge > > &  mcb,
leda::array< leda::list< leda::edge > > &  proof
 

Compute a MCB of an undirected unweighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of list of edges called mcb. The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
mcb An array of list of edges to return the MCB.
proof An array of list of edges to return the proof.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

int mcb::MIN_CYCLE_BASIS_DEPINA const leda::graph &  g,
leda::array< mcb::spvecgf2 > &  mcb,
const edge_num &  enumb
 

Compute a MCB of an undirected unweighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of sparse vectors, spvecgf2, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
mcb A leda::array of spvecgf2 to return the MCB.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

int mcb::MIN_CYCLE_BASIS_DEPINA const leda::graph &  g,
leda::array< mcb::spvecgf2 > &  mcb,
leda::array< mcb::spvecgf2 > &  proof,
const edge_num &  enumb
 

Compute a MCB of an undirected unweighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of sparse vectors, spvecgf2, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb. The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
mcb A leda::array of spvecgf2 to return the MCB.
proof A leda::array of spvecgf2 to return the proof.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

int mcb::MIN_CYCLE_BASIS_DEPINA const leda::graph &  g,
leda::array< leda::d_int_set > &  mcb,
const edge_num &  enumb
 

Compute a MCB of an undirected unweighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of dynamic integer sets, leda::d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
mcb A leda::array of leda::d_int_set to return the MCB.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

int mcb::MIN_CYCLE_BASIS_DEPINA const leda::graph &  g,
leda::array< leda::d_int_set > &  mcb,
leda::array< leda::d_int_set > &  proof,
const mcb::edge_num enumb
 

Compute a MCB of an undirected unweighted graph using de Pina's algorithm.

The function computes a Minimum Cycle Basis $B$ of a graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of dynamic integer sets, leda::d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb. The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^3 )$ where $m$ are the number of edges of $g$.

Parameters:
g An undirected graph.
mcb A leda::array of leda::d_int_set to return the MCB.
proof A leda::array of leda::d_int_set to return the proof.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree.

template<class W>
W mcb::MIN_CYCLE_BASIS_HYBRID const graph &  g,
const edge_array< W > &  len,
array< list< edge > > &  mcb
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected weighted graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges called mcb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::d_int_set to return the MCB.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

len is non-negative

template<class W>
W mcb::MIN_CYCLE_BASIS_HYBRID const graph &  g,
const edge_array< W > &  len,
array< list< edge > > &  mcb,
array< list< edge > > &  proof
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected weighted graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges called mcb.

The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::list of edges to return the MCB.
proof A leda::array of leda::list of edges to return the proof.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

len is non-negative

template<class W>
W mcb::MIN_CYCLE_BASIS_HYBRID const graph &  g,
const edge_array< W > &  len,
array< d_int_set > &  mcb,
const edge_num &  enumb
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected weighted graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of dynamic integer sets, d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::d_int_set to return the MCB.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

len is non-negative

template<class W>
W mcb::MIN_CYCLE_BASIS_HYBRID const graph &  g,
const edge_array< W > &  len,
array< d_int_set > &  mcb,
array< d_int_set > &  proof,
const edge_num &  enumb
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected weighted graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of dynamic integer sets, d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
len A leda::edge_array for the edge lengths.
mcb A leda::array of leda::d_int_set to return the MCB.
proof A leda::array of leda::d_int_set to return the proof.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

len is non-negative

int mcb::MIN_CYCLE_BASIS_HYBRID const leda::graph &  g,
leda::array< leda::list< leda::edge > > &  mcb
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges called mcb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
mcb A leda::array of leda::list of edges to return the MCB.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

int mcb::MIN_CYCLE_BASIS_HYBRID const leda::graph &  g,
leda::array< leda::list< leda::edge > > &  mcb,
leda::array< leda::list< leda::edge > > &  proof
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of lists of edges called mcb.

The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
mcb A leda::array of leda::list of edges to return the MCB.
proof A leda::array of leda::list of edges to return the proof.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

int mcb::MIN_CYCLE_BASIS_HYBRID const leda::graph &  g,
leda::array< leda::d_int_set > &  mcb,
const edge_num &  enumb
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of dynamic integer sets, d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
mcb A leda::array of leda::d_int_set to return the MCB.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

int mcb::MIN_CYCLE_BASIS_HYBRID const leda::graph &  g,
leda::array< leda::d_int_set > &  mcb,
leda::array< leda::d_int_set > &  proof,
const edge_num &  enumb
 

Compute a minimum cycle basis using a hybrid algorithm.

The function computes a minimum cycle basis of an undirected graph $g$, that is a cycle basis of $g$ with the smallest length (sum of lengths of cycles). The basis is returned as an array of dynamic integer sets, d_int_set, called mcb.

Every edge is represented by some integer, by a fixed and arbitrary numbering. This numbering is represented by enumb.

The function also returns a certificate of optimality of the minimum cycle basis. More precisely a set of linearly independent vectors for which cycle $i$ is the shortest cycle in $g$ with odd intersection with the proof vector $i$.

The function returns the weight of the Minimum Cycle Basis or is undefined if there were any errors.
The running time is $O( m^2 n^2 )$ where $m$ are the number of edges of $g$ and $n$ the number of vertices.

Parameters:
g An undirected graph.
mcb A leda::array of leda::d_int_set to return the MCB.
proof A leda::array of leda::d_int_set to return the proof.
enumb An edge numbering.
Returns:
The length of the MCB or undefined if some error occured.
Precondition:
g is undirected, simple and loopfree

std::ostream& mcb::operator<< std::ostream &  o,
const spvecfp &  v
 

Output a sparse vector to a stream.

Parameters:
o The stream to output to.
v The sparse vector to output to.
Returns:
The stream after outputing.

std::ostream& mcb::operator<< std::ostream &  o,
const spvecgf2 &  v
 

Output a sparse vector.

Parameters:
o The stream to output to.
v The sparse vector to output.
Returns:
The stream after output.

std::istream& mcb::operator>> std::istream &  o,
spvecgf2 &  v
 

Input a sparse vector.

Parameters:
o The stream to input from.
v Where to store the sparse vector.
Returns:
The stream after reading.


Generated on Thu Mar 30 16:45:51 2006 for mcb LEDA Extension Package by  doxygen 1.4.6