https://github.com/dwarfmaster/blossom
Implementation of the blossom algorithm
https://github.com/dwarfmaster/blossom
Last synced: 8 months ago
JSON representation
Implementation of the blossom algorithm
- Host: GitHub
- URL: https://github.com/dwarfmaster/blossom
- Owner: dwarfmaster
- License: mit
- Created: 2018-01-12T09:38:24.000Z (over 8 years ago)
- Default Branch: blossom
- Last Pushed: 2019-07-16T06:26:49.000Z (almost 7 years ago)
- Last Synced: 2025-02-07T02:48:21.634Z (over 1 year ago)
- Language: C++
- Size: 535 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Blossom
=======
This is an implementation of the Blossom algorithm in O(nm a(n)) where n is the
number of vertices in the graph, m the number of edges and a is the inverse
Ackermann function.
Input
-----
It expects a description of the graph on its standard input. The graph is a
succession of number. First is the number of nodes n, then the number of edges m,
then the edges as couples of numbers (identifier of nodes between 0 included and
n not included). For example, the cycle of size 5 would be :
```
5 5
0 1
1 2
2 3
3 4
4 0
```
Output
------
The program outputs the matching in the form of a list of edges, each being two
nodes identifiers separated by `--`. For the cycle of size 5, an output could
be :
```
0 -- 1
2 -- 3
```
It also outputs the duration of the execution of the blossom function in
microseconds, without the time to load the graph or print the output.