All Projects → morpheusthewhite → parallel-dfs-dag

morpheusthewhite / parallel-dfs-dag

Licence: MIT License
A parallel implementation of DFS for Directed Acyclic Graphs (https://research.nvidia.com/publication/parallel-depth-first-search-directed-acyclic-graphs)

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to parallel-dfs-dag

breaking cycles in noisy hierarchies
breaking cycles in noisy hierarchies
Stars: ✭ 59 (+103.45%)
Mutual labels:  dfs, bfs, dag
crazycat
使用Canvas制作的围住神经猫,算法基于广度优先搜索实现。
Stars: ✭ 18 (-37.93%)
Mutual labels:  dfs, bfs
Artificial-Intelligence-State-Space-Search
Different Searching algorithms (DFS, BFS, IDS, Greedy, A*) opting to find optimal path from source to destination
Stars: ✭ 24 (-17.24%)
Mutual labels:  dfs, bfs
icpc
Resources for Competitive Programming
Stars: ✭ 14 (-51.72%)
Mutual labels:  dfs, bfs
Work Stealing Queue
A fast work-stealing queue template in C++
Stars: ✭ 124 (+327.59%)
Mutual labels:  parallel-computing, multithreading
Dag
🐠 An Angular service for managing directed acyclic graphs
Stars: ✭ 111 (+282.76%)
Mutual labels:  graph, dag
ParallelQSlim
Shape Aware Parallel Mesh Simplification Algorithm
Stars: ✭ 84 (+189.66%)
Mutual labels:  parallel-computing, multithreading
Taskflow
A General-purpose Parallel and Heterogeneous Task Programming System
Stars: ✭ 6,128 (+21031.03%)
Mutual labels:  parallel-computing, multithreading
java-multithread
Códigos feitos para o curso de Multithreading com Java, no canal RinaldoDev do YouTube.
Stars: ✭ 24 (-17.24%)
Mutual labels:  parallel-computing, multithreading
pathfinding-visualizer
A web app to help visualizing typical graph searching algorithms
Stars: ✭ 16 (-44.83%)
Mutual labels:  dfs, bfs
variadic future
Variadic, completion-based futures for C++17
Stars: ✭ 41 (+41.38%)
Mutual labels:  multithreading, futures
Pelagia
Automatic parallelization (lock-free multithreading thread) tool developed by Surparallel Open Source.Pelagia is embedded key value database that implements a small, fast, high-reliability on ANSI C.
Stars: ✭ 1,132 (+3803.45%)
Mutual labels:  parallel-computing, multithreading
Openmp Examples
openmp examples
Stars: ✭ 64 (+120.69%)
Mutual labels:  parallel-computing, multithreading
X6
🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
Stars: ✭ 2,686 (+9162.07%)
Mutual labels:  graph, dag
Future
🚀 R package: future: Unified Parallel and Distributed Processing in R for Everyone
Stars: ✭ 735 (+2434.48%)
Mutual labels:  parallel-computing, futures
b-rabbit
A thread safe library that aims to provide a simple API for interfacing with RabbitMQ. Built on top of rabbitpy, the library make it very easy to use the RabbitMQ message broker with just few lines of code. It implements all messaging pattern used by message brokers
Stars: ✭ 15 (-48.28%)
Mutual labels:  parallel-computing, multithreading
CPURasterizer
CPU Based Rasterizer Engine
Stars: ✭ 99 (+241.38%)
Mutual labels:  parallel-computing, multithreading
Hamsters.js
100% Vanilla Javascript Multithreading & Parallel Execution Library
Stars: ✭ 517 (+1682.76%)
Mutual labels:  parallel-computing, multithreading
tiki
Library for functional graph & geometry algorithms
Stars: ✭ 20 (-31.03%)
Mutual labels:  dfs, bfs
future.callr
🚀 R package future.callr: A Future API for Parallel Processing using 'callr'
Stars: ✭ 52 (+79.31%)
Mutual labels:  parallel-computing, futures

Parallel DFS for Directed Acyclic Graphs

This is a C++ implementation of a parallel algorithm of the DFS traversal, according to this paper. The idea under this algorithm is overcoming the problems of parallel implementations of the standard DFS-based labelling approach. That's because DFS requires a strict ordering in edges visitation and the usage of some global variables, which represent a great limitation whenever there is the need to go parallel.

This algorithm provides an efficient solution for the DFS traversal of directed acyclic graph (DAG) with no more than 3 BFS visits, which allow to find as result the pre-order, post-order and the parent relationship between the nodes of the DAG.

  • The first BFS visit is aimed to convert the DAG to a DT (Figure B);
  • The next visit is done on the DT and has the role to find, for each node, the subtree size, defined as the number of nodes reachable from it, plus itself (Figure C);
  • With the third visit, it is possible to obtain the number of
    nodes which should be previously visited according to the DFS visitation order, looking at the subtree size of the preceding siblings of the current node and preceding siblings of the parents (Figure D). Starting from the previously worked out values, we obtain post order and pre order (the latter is not worked out in this implementation, but this can easily be done with very minimal changes to the code) (Figure E).

Note that this implementation has an additional BFS visit on the DAG (Figure F), aimed to compute outer and inner rank, respectively defined as

  • post order + 1 (e_v or outer rank)
  • equal to the outer rank if the node has no children, the minimum of the outer ranks of the children otherwise (s_v or inner rank).

More info (except regarding ranks) in the paper.

Example of visit

Running

For building the project use the provided CMakeLists.txt, with the following commands

$ mkdir -p build && cd build && cmake .. && make && cp parallel-dfs-dag .. && cd ..

The program receive a file containing the initial dag with the following format

<number of nodes>
0: <node1> <node2> ... #
...

<nodeId>: <nodeN> <nodeM> ... #

...

The initial line contains the number of nodes while all the next lines have the same format, starting with the (numeric) node identifier (must be incremental) followed by a colon and the the list of the nodes to which the current node points to.

For example the DAG of the previous example is represented as

7
0: 1 2 #
1: 3 4 #
2: 4 5 #
3: #
4: 6 #
5: 6 #
6: #

The third argument of the executable is the name of the file into which the ranks are going to be saved, with format:

node_number sv ev

The following is the content of the output file of the previous example:

0 1 7
1 1 4
2 2 6
3 1 1
4 2 3
5 2 5
6 2 2
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].