dkondor / maxmatch_MV

Micali Vazirani Maximum Cardinality Matching Algorithm for symmetric (undirected) graphs
7 stars 2 forks source link

maxmatch_MV

Micali Vazirani Maximum Cardinality Matching Algorithm for symmetric (undirected) graphs. Adapted from https://github.com/jorants/MV-Matching-V2

Adapted to C++; the main motivation was to use less memory to allow significantly larger graphs to process (>1 billion edges and a few million nodes).

Usage:

compiling with g++:

g++ -o mmmv *.cpp -O3 -march=native -std=gnu++14

running:

./mmmv < graph_edges.dat > maxmatch_edges.dat

Note: the graph is expected as a list of edges, which are assumed to be undirected. If the input is already sorted / partitioned (i.e. all appearances of a node in the first column are grouped together), the -p switch can be used to halve the memory usage while reading the graph (from 8 bytes / edge to 4 bytes / edge).

Changes:

Main changes from the original version: