https://github.com/yothgewalt/single-source-shortest-paths
This repository implements Single Source Shortest Paths (SSSP) algorithms in Go.
https://github.com/yothgewalt/single-source-shortest-paths
algorithm go graph sssp
Last synced: 3 months ago
JSON representation
This repository implements Single Source Shortest Paths (SSSP) algorithms in Go.
- Host: GitHub
- URL: https://github.com/yothgewalt/single-source-shortest-paths
- Owner: yothgewalt
- Created: 2025-08-24T09:14:08.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-08-24T09:14:33.000Z (3 months ago)
- Last Synced: 2025-08-31T10:58:48.382Z (3 months ago)
- Topics: algorithm, go, graph, sssp
- Language: Go
- Homepage: https://arxiv.org/pdf/2504.17033
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Single Source Shortest Paths (SSSP) Algorithm
This repository implements Single Source Shortest Paths (SSSP) algorithms in Go. SSSP algorithms find the shortest paths from a given source vertex to all other vertices in a weighted graph.
## Features
- Graph data structure implementation
- Priority queue for efficient shortest path computation
- SSSP algorithm (e.g., Dijkstra's algorithm)
- Example usage in `main.go`
## File Structure
- `graph.go`: Graph representation and related methods
- `priority_queue.go`: Priority queue implementation
- `single_source_shortest_paths.go`: SSSP algorithm implementation
- `data_structure.go`: Supporting data structures
- `main.go`: Entry point and example usage
- `go.mod`: Go module definition
## Usage
1. **Clone the repository:**
```zsh
git clone github.com/yothgewalt/single-source-shortest-paths.git
cd single-source-shortest-paths
```
2. **Run the example:**
```zsh
go run main.go
```
## Example
Below is a simple example of how to use the SSSP algorithm:
```go
// ...existing code...
source := 0
shortestPaths := SSSP(graph, source)
fmt.Println("Shortest paths from source:", shortestPaths)
// ...existing code...
```
## Algorithms Implemented
- Dijkstra's Algorithm (for graphs with non-negative weights)