This windows application offers the functionality of computing three different centrality metrics for a given undirected weighted network/graph:
- Degree Centrality
- Closeness Centrality
- Betweenness Centrality
Computation is made using C++, and the computed results can then be visualized through an Electron app based on the D3.js visualization library.
-
To run the visualization app.
-
To run the executable algorithm files stored in the
/executables
directory.
- Fork or download repo as zip.
- In the repo directory run
cd ./visualization && npm install
. - In the
input.txt
file found in the root of the repo, enter the representation of your network as follows:- The first line will contain two integers n,m where n is the number of nodes and m is the number of edges in the graph (1 < n < V, 0 < m < E ).
- This will be followed by m lines describing the edges of the graph.
- Each of the m lines will contain two integers a, b, c that represents an undirected edge between nodes a and b with weight c.
- execute
run.exe
to compute and visualize the results.
When you double click on run.exe
here's what this executable file goes through:
- It runs the executable files stored in the
/executables
directory using WSL withinput.txt
as input. - These executables produce three different text files. One for the degree centrality measures, one for the closeness centrality measures, and one for the betweenness centrality measures.
- These three files, as well as
input.txt
, are ran through a script that produce a.json
file matching the format specified by the visualization library. - The
.json
file is then fed to the electron visualization app which plots the graph and displays an interactive table with all the computed centrality measures.