Skip to content

SSSP Algorithm

License

Notifications You must be signed in to change notification settings

jc4st3lls/sssp-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSSP Algorithm

A collection of Rust projects implementing efficient Single Source Shortest Path (SSSP) algorithms for graphs. This workspace includes a core library, WebAssembly bindings, and a web server with API.

Projects

1. sssp-lib - Core Library

The foundational Rust library providing SSSP algorithms using a bounded-memory shortest path approach. Suitable for large graphs with memory and computation constraints.

  • Features: Efficient graph representation, Dijkstra-like algorithm with bounds, random graph generation for testing.
  • Use Case: Backend processing, performance-critical applications.
  • Installation: cargo add sssp-lib
  • Documentation: sssp-lib README | crates.io | docs.rs

2. sssp-wasm - WebAssembly Bindings

JavaScript bindings for the SSSP library, compiled to WebAssembly. Enables running SSSP algorithms directly in the browser with near-native performance.

  • Features: WASM compilation, JS API for graph operations and path calculation, interactive web demo.
  • Use Case: Web applications, client-side graph processing, educational tools.
  • Build: wasm-pack build --target web
  • Documentation: sssp-wasm README

3. sssp-server - Web Server & API

A REST API server built with Axum, serving SSSP computations via HTTP endpoints. Includes static file serving for web interfaces.

  • Features: RESTful API for path calculations, web-based graph visualization, CORS support.
  • Use Case: Web services, API backends, demo applications.
  • Run: cargo run (from sssp-server directory)
  • API Endpoint: POST /api/calculate for path computation.
  • Documentation: sssp-server README

Screenshots

Screenshots

Quick Start

Using the Library

use sssp_lib::SSSPAlgorithm;

let mut algo = SSSPAlgorithm::new(5);
algo.graph.add_edge(0, 1, 1.0);
let distances = algo.run(0);
println!("{:?}", distances);

Running the Server

cd sssp-server
cargo run
# Visit http://localhost:8000

Building WASM

cd sssp-wasm
wasm-pack build --target web
# Use in web projects

Architecture

  • sssp-lib: Pure Rust implementation with no external dependencies.
  • sssp-wasm: Thin WASM wrapper around sssp-lib using wasm-bindgen.
  • sssp-server: HTTP server using sssp-lib for computations, serves web UI.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

License

Contributing

⚠️ Note: This is a read-only repository for educational purposes. Pull Requests and Issues are not accepted. If you wish to experiment with the code, please Fork or Clone the repository.

About

SSSP Algorithm

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published