This package contains implementations of algorithms to compute minimum cycle bases for weighted directed and undirected graphs.
algorithm due to J.C. de Pina. A description of this algorithm and an even faster one can be found here.
hybrid algorithm, which is a mixture of the above algorithm and an older algorithm due to Horton. For more details see here.
implementation of an
algorithm due to T. Kavitha, which appeared in ICALP'05.but it may work on others too.
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.
#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 } } }
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 ); }
1.4.6