Skip to content

Vlm326/NetAnalysys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

116 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetAnalysys

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.

Features

  • Multi-format graph loading.txt, .csv, .mtx with 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

Datasets

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)

Quick Start

cargo run

Select a graph file from the built-in file browser, choose a diameter estimation method, and the analysis pipeline runs automatically.

Requirements

  • Rust stable toolchain
  • Terminal with crossterm support

Usage

  1. Launch the application
  2. Load a graph dataset (samples in graphs/)
  3. Select diameter method: Double BFS, Random 500 BFS, Snowball sampling, or All
  4. Review computed metrics, terminal charts, and saved PNG plots
  5. Optionally enter the interactive landmark mode for pairwise distance queries and benchmarks

Supported Formats

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.

Architecture

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.

Performance

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.

Output Artifacts

  • degree_data1.png — degree distribution plot
  • log_degree_data.png — log-log degree distribution plot
  • performance.log — per-stage execution timings
  • trace.log — pipeline trace events

Development

cargo build              # Compile
cargo test               # Run tests
cargo fmt                # Format code
cargo clippy --all-targets --all-features  # Lint

Contributing

Contributions are welcome. Please open an issue to discuss changes before submitting a pull request. Ensure the project builds without warnings and passes cargo clippy.

License

MIT — see LICENSE.

About

Blazzingly fast graph analyzer written on rust

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors