tomekkorbak / parallel-b-suitors

A parallel C++ implementation of b-suitors algorithm for solving the b-matching problem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo contains a school project of mine: the task was to write, fine-tune and evaluate an efficient parallel implementation of an b-suitors algorithm (Khan et al., 2016) for solving the problem of finding a maximal b-matching of a weighted undirected graph. The problem of b-matching generalizes the graph matching problem: the goal is to match each vertex with at most b other vertices in a way that maximizes their weights. This problem has some interesting applications in privacy-aware machine learning (cf. adaptive anonymity).

Design outline

A C++14 implementation of b-suitors algorithm was prepared that can be provided with an arbitrary pre-defined (maximal) number of threads and an arbitrary assignment of b to each vertex. In its main loop, the algorith iterates over vertices trying to find the best matches, until a vertex finds b matches or there is no eligible candidate left. This loop was implemented to run in parallel for each vertex. Threads are joined at the end of each full iteration over the graph. Additionally, exclusive access to the matching queue was ensured for each thread when finalizing the matching.

The scheduling regime employed was a thread pool with fixed number of threads and FIFO task queue.

The implementation was evaluated on datasets from Stanford Large Network Dataset Collection.

Quickstart

cmake .
./adorate thread-count inputfile b-limit

inputfile is a path to file containing the graph (each line specifies two vertices ids and a weight). b-limit is the maximal b. blimit.cpp implements an assignment of b to each vertex.

About

A parallel C++ implementation of b-suitors algorithm for solving the b-matching problem

License:MIT License


Languages

Language:C++ 93.3%Language:CMake 5.4%Language:C 1.3%