GithubHelp home page GithubHelp logo

wille097 / edmonds-alg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atofigh/edmonds-alg

0.0 0.0 0.0 88 KB

Implementation of maximum branching algorithm (max spanning tree in directed graphs)

License: MIT License

Python 3.41% C++ 96.59%

edmonds-alg's Introduction

Edmonds's Algorithm

This project contains an efficient implementation of Edmonds's optimum branching algorithm as originally described by Tarjan.

For information on the licence, please refer to the file COPYING. For usage information see the file INSTALL.

Introduction

The package edmonds-alg contains a C++-implementation of Edmonds's optimum branching algorithm as described by Tarjan in 1977. The code is licensed under the open source MIT license.

A branching in a directed graph is defined as a set of directed edges that contain no cycles and such that no two edges are directed towards the same vertex. Note that this is equivalent to a forest of rooted trees. Given weights on the edges of a directed graph, we define a maximum branching as a branching such that the sum of the weights of its edges is maximal. Since finding a maximum branching is equivalent to finding a minimum branching, we often speak of optimum branchings instead.

In 1967, Edmonds gave an algorithm for finding an optimum branching in a directed graph (others discovered similar algorithms independantly at approximately the same time). In 1977, Tarjan gave the first description of an efficient implementation of Edmonds's algorithm.

Requirements

In order to maximize code reuse, the implementation is built on top of concepts in the Boost Graph Library The package also uses some other parts of Boost, most notably, Boost foreach which was first introduced in Boost version 1.34. Therefore, Boost version 1.34 or later is required for use of this package.

Scons is used as a build tool to build the accompanying documentation and test programs. Also, test scripts are written in Python. The pdf documentation is written in LaTeX

Installation

The algorithm is implemented as a single template function in C++, and as such, no libraries or executables need to be built. To use the function, just copy the files

src/edmonds_optimum_branching.hpp
src/edmonds_optimum_branching_impl.hpp

to suitable locations where your compiler looks for header files. Under Linux, a good place is usually /urs/include. You can also just copy the two header files directly to the source directory of your program. Any source file from which a call is made should include the header edmonds_optimum_branching.hpp.

If you want to build the accompanying documentation and test programs, you need to have Scons and Python installed (see Requirements above). To build and test on Linux, run the following commands from the root of the source directory:

scons
scons test

Or if the boost library is in a non-standard location, use the following commands instead:

scons boost=/path/to/boost/installation/root
scons boost=/path/to/boost/installation/root test

Information on how to use the algorithm, see the file edmonds_optimum_branching.hpp. Also, a good example of usage can be found in the test program test/test.cpp. In the future, more examples may be provided (feedback from users may speed up this process).

edmonds-alg's People

Contributors

atofigh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.