NetAnalysys is a high-performance terminal-based graph analysis toolkit written in Rust. It loads graph datasets, computes structural metrics, estimates shortest-path distances via landmark methods, and provides interactive exploration — all within a TUI.
- Multi-format graph loading —
.txt,.csv,.mtxwith automatic ID remapping - Graph characterization — type, order, size, density, degree distribution
- Connectivity analysis — weak & strong (Tarjan's SCC) components, largest component fraction
- Diameter estimation — Double BFS, random-sampled BFS, snowball sampling
- Triangle counting & clustering — global and average clustering coefficients
- Robustness analysis — LCC degradation under random and hub-targeted vertex removal
- Landmark-based distance estimation — Random, Highest-degree, and Farthest-first selection strategies
- Accuracy benchmarking — landmark estimates vs exact BFS over random vertex pairs
- Visualization — terminal-printed degree distribution charts + PNG export via plotters
- Performance logging — structured duration logs for all pipeline stages
The project has been validated on publicly available real-world graph datasets, located in graphs/:
| Dataset | Type | Source |
|---|---|---|
web-Google |
Directed | Google web graph |
web-NotreDame |
Directed | Notre Dame web graph |
web-Stanford |
Directed | Stanford web graph |
Wiki-Vote |
Directed | Wikipedia voting network |
soc-wiki-Vote |
Directed | Wikipedia vote matrix (MTX) |
CA-AstroPh |
Undirected | ArXiv Astro Physics co-authorship |
CA-GrQc |
Undirected | ArXiv General Relativity co-authorship |
ca-coauthors-dblp |
Undirected | DBLP co-authorship |
Email-EuAll |
Undirected | Email network from EU institution |
musae_git_edges |
Undirected | GitHub developer social network |
com-orkut.ungraph |
Undirected | Orkut social network (large) |
com-youtube.ungraph |
Undirected | YouTube social network (large) |
vk |
Undirected | VK social network (large) |
cargo runSelect a graph file from the built-in file browser, choose a diameter estimation method, and the analysis pipeline runs automatically.
- Rust stable toolchain
- Terminal with crossterm support
- Launch the application
- Load a graph dataset (samples in
graphs/) - Select diameter method:
Double BFS,Random 500 BFS,Snowball sampling, orAll - Review computed metrics, terminal charts, and saved PNG plots
- Optionally enter the interactive landmark mode for pairwise distance queries and benchmarks
| Format | Separator | Comments |
|---|---|---|
.txt |
whitespace | Lines starting with # are ignored |
.csv |
comma | Leading/trailing whitespace trimmed |
.mtx |
whitespace | MatrixMarket: % comments, first non-comment line is the header |
Graph direction is inferred from the parent folder name: Directed/ → directed, Undirected/ → undirected, default is undirected.
src/
analysis/ — Metrics: connectivity, degree, diameter, robustness, triangles, clustering
graph/ — Graph representation (adjacency list, ID mapping) and BFS/DFS traversal
landmarks/ — Landmark selection strategies (Random, Highest-degree, Farthest-first)
interactive_landmarks/ — TUI for landmark-based distance queries and benchmarking
parser/ — File format detection and parsing
ui/ — Terminal UI (menus, degree chart rendering, PNG export)
main.rs — Orchestration pipeline and entry point
The graph uses compact internal vertex IDs with bidirectional mapping to external dataset IDs. Computations are parallelised with Rayon and Tokio where applicable.
Processing time scales with graph size. Small datasets (up to ~100K edges) complete in milliseconds. The full analysis pipeline on com-orkut (~117M edges) takes approximately 22 minutes on a standard office laptop without overclocking.
degree_data1.png— degree distribution plotlog_degree_data.png— log-log degree distribution plotperformance.log— per-stage execution timingstrace.log— pipeline trace events
cargo build # Compile
cargo test # Run tests
cargo fmt # Format code
cargo clippy --all-targets --all-features # LintContributions are welcome. Please open an issue to discuss changes before submitting a pull request. Ensure the project builds without warnings and passes cargo clippy.
MIT — see LICENSE.