Minimum Cycle Basis Leda Extension Package

0.6

Introduction

A minimum cycle basis is a basis of the cycle space of a graph with minimum weight. The weight of a minimum cycle basis is the sum of the weights of its cycles and the weight of a cycle is the sum of the weights of its edges.

This package contains implementations of algorithms to compute minimum cycle bases for weighted directed and undirected graphs.

Algorithms

Undirected Graphs

Directed Graphs

Requirements

This implementation is written in C++ and uses LEDA. The structure of the package follows that of a LEDA extension package (LEP).

Supported Platforms

This package has been tested on the following platforms:
  1. gcc 3.x under Linux, SunOS 5.9, Cygwin
  2. bcc32 5.5 under Windows
  3. Visual Studio .NET 2003

but it may work on others too.

License

  This program can be freely used in an academic environment
  ONLY for research purposes, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     an acknowledgment in the product documentation is required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

  Any other use is strictly prohibited by the author, without an explicit
  permission.

  This software is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  

Note that this package uses LEDA, which is not free.

News

Download

Code Examples

Undirected

  #include <LEP/mcb/min_cycle_basis.h>
  int main() {

        leda::graph G;

        // construct simple, loopfree, undirected graph G 

        leda::edge_array<int> len(G, 1);

        // fill up non-negative edge lengths 

        mcb::edge_num enumb( G );
        leda::array< mcb::spvecgf2 > mcb;
        int weight = mcb::MIN_CYCLE_BASIS_DEPINA( G, len, mcb, enumb ); 

        int i,j;
        leda::edge e;
        for( i = 0; i < enumb.dim_cycle_space(); i++ ) {
                forall( j, mcb[i] ) { // traverse edges of i-th cycle
                        e = enumb( j );

                        // do something with edge e 
                }
        }
  } 

Directed

 int main() {

   leda::graph G;

   // construct simple, loopfree, directed graph G 

   leda::edge_array<int> len(G, 1);

   // fill up positive edge lengths 

   leda::array< leda::list<leda::edge> > mcb;
   int weight = mcb::DIR_MIN_CYCLE_BASIS( G, len, mcb );
 }

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