1 | CLI for nvGraph, which is a GPU-based graph analytics library written by NVIDIA, using CUDA.<br>
|
2 | 🐚 [Shell](https://www.npmjs.com/package/nvgraph.sh),
|
3 | 📜 [Files](https://unpkg.com/nvgraph.sh/),
|
4 | 📘 [Wiki](https://github.com/nodef/nvgraph.sh/wiki/).
|
5 |
|
6 | This is for running [nvGraph] functions right from the [CLI] with graphs in
|
7 | [MatrixMarket] format (`.mtx`) directly. It just needs a [x86_64] linux machine
|
8 | with NVIDIA GPU drivers installed. Execution time, along with the results can be
|
9 | saved in [JSON]/[YAML] file. The [executable code] is written in C++. You can
|
10 | install this with `npm install -g nvgraph.sh`.
|
11 |
|
12 | **nvGraph**, as mentioned above, is a **GPU-based graph analytics library**
|
13 | written by *NVIDIA*. It provides four core graph algorithms: Single Source
|
14 | Shortest Path ([SSSP]), [PageRank], [Triangle count], and Breadth First Search
|
15 | ([BFS]) traversal. Data is loaded into the GPU in Compressed Sparse Row ([CSR])
|
16 | format, upon which computation is performed. Here, we load the graph stored in
|
17 | **MatrixMarket format** (a text-based file format for sparse matrices) into a
|
18 | dynamic graph data structure in the host (CPU) memory, which is then converted
|
19 | to CSR format and then transferred to the device (GPU) memory. **Computed results**
|
20 | are then copied back to the host memory, and written to the **output file**
|
21 | in suitable format (**JSON/YAML**). Note that **measured time** only includes
|
22 | the time required for **computation** on the GPU.
|
23 |
|
24 | The **SSSP** algorithm accepts the *source vertex* as an argument, and returns
|
25 | the *shortest distance* to each vertex form the source vertex. The **PageRank**
|
26 | algorithm accepts the *damping factor*, *tolerance*, and *max. iterations* as
|
27 | arguments, and returns the *rank* of each vertex. In addition to ranks of
|
28 | vertices in case of the **PageRank** algorithm, we like to also obtain additional
|
29 | analytics of the rank values, i.e., [Lorenz curve], and [Gini coefficient]. The
|
30 | **Triangle count** algorithm, unsurprisingly, counts the *number of triangles*
|
31 | in the graph. The **BFS** traversal algorithm accepts the *source vertex* as an
|
32 | argument, traverses the graph in breadthwise manner, and returns the *distance*
|
33 | and *predecessor* of each vertex from the source vertex. Note that
|
34 | **detailed results** are written to the output file only when the **full**
|
35 | (`-f`) flag is provided.
|
36 |
|
37 | Alas, **nvGraph** is now no more actively developed. NVIDIA started developing
|
38 | [cuGraph] a collection of graph analytics that process data found in GPU
|
39 | Dataframes as part of [RAPIDS].
|
40 |
|
41 | > Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
|
42 |
|
43 | [nvGraph]: https://github.com/rapidsai/nvgraph
|
44 | [CLI]: https://en.wikipedia.org/wiki/Command-line_interface
|
45 | [x86_64]: https://en.wikipedia.org/wiki/X86-64
|
46 | [MatrixMarket]: https://math.nist.gov/MatrixMarket/formats.html
|
47 | [JSON]: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON
|
48 | [YAML]: https://en.wikipedia.org/wiki/YAML
|
49 | [executable code]: src/cxx
|
50 | [SSSP]: https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/
|
51 | [PageRank]: https://www.geeksforgeeks.org/page-rank-algorithm-implementation/
|
52 | [Triangle count]: https://www.geeksforgeeks.org/number-of-triangles-in-a-undirected-graph/
|
53 | [BFS]: https://www.geeksforgeeks.org/breadth-first-search-or-bfs-for-a-graph/
|
54 | [CSR]: https://www.geeksforgeeks.org/sparse-matrix-representations-set-3-csr/
|
55 | [Lorenz curve]: https://en.wikipedia.org/wiki/Lorenz_curve
|
56 | [Gini coefficient]: https://en.wikipedia.org/wiki/Gini_coefficient
|
57 | [cuGraph]: https://github.com/rapidsai/cugraph
|
58 | [RAPIDS]: https://rapids.ai/
|
59 |
|
60 | <br>
|
61 |
|
62 | ```bash
|
63 | ## Finds single source shortest path from source vertex
|
64 | ## → returns distances
|
65 | $ nvgraph sssp -o=out.json -f web-Google.mtx -s=1
|
66 |
|
67 | ## Finds pagerank of all vertices
|
68 | ## → returns ranks
|
69 | $ nvgraph pagerank -o=out.json -f web-Google.mtx -a=0.85 -t=1e-6
|
70 |
|
71 | ## Counts triangles in undirected, lower triangular graph
|
72 | ## → returns count
|
73 | $ nvgraph triangle-count -o=out.json -f web-Google.mtx
|
74 |
|
75 | ## Traverses breadth-first from source vertex
|
76 | ## → returns distances, predecessors
|
77 | $ nvgraph traversal-bfs -o=out.json -f web-Google.mtx -s=1
|
78 | ```
|
79 |
|
80 | <br>
|
81 | <br>
|
82 |
|
83 |
|
84 | ## Index
|
85 |
|
86 | | Command | Action |
|
87 | | --------------- | ---------------------------- |
|
88 | | [pagerank][01] | Finds pagerank of all vertices. |
|
89 | | [sssp][02] | Finds single source shortest path from source vertex. |
|
90 | | [traversal-bfs][03] | Traverses breadth-first from source vertex. |
|
91 | | [triangle-count][04] | Counts triangles in undirected, lower triangular graph. |
|
92 |
|
93 | <br>
|
94 | <br>
|
95 |
|
96 |
|
97 | ## References
|
98 |
|
99 | - [nvGraph pagerank example, EN605.617, JHU-EP-Intro2GPU](https://github.com/JHU-EP-Intro2GPU/EN605.617/blob/master/module9/nvgraph_examples/nvgraph_Pagerank.cpp)
|
100 | - [nvGraph pagerank example, CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/archive/10.0/nvgraph/index.html#nvgraph-pagerank-example)
|
101 | - [nvGraph Library User's Guide](https://docs.nvidia.com/cuda/archive/10.1/pdf/nvGRAPH_Library.pdf)
|
102 | - [RAPIDS nvGraph NVIDIA graph library](https://github.com/rapidsai/nvgraph)
|
103 | - [Get path of current script when executed through a symlink](https://unix.stackexchange.com/a/17500/166668)
|
104 |
|
105 | <br>
|
106 | <br>
|
107 |
|
108 | [![](https://img.youtube.com/vi/3s9psf01ldo/maxresdefault.jpg)](https://www.youtube.com/watch?v=3s9psf01ldo)
|
109 | [![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
|
110 | [![DOI](https://zenodo.org/badge/362208913.svg)](https://zenodo.org/badge/latestdoi/362208913)
|
111 |
|
112 |
|
113 | [01]: https://github.com/nodef/nvgraph.sh/wiki/pagerank
|
114 | [02]: https://github.com/nodef/nvgraph.sh/wiki/sssp
|
115 | [03]: https://github.com/nodef/nvgraph.sh/wiki/traversal-bfs
|
116 | [04]: https://github.com/nodef/nvgraph.sh/wiki/triangle-count
|