Graft is a graph analysis framework written in Rust, designed for high performance and safe concurrency. It provides implementations of classic graph algorithms with modern optimizations.
- 🚀 High Performance with built-in concurrency
- 🔒 Thread-safe using concurrent data structures
- 📊 Classic Graph Algorithms:
- Minimum Spanning Tree (Prim's Algorithm)
- Maximum Flow (Ford-Fulkerson Algorithm)
- 🧮 Powerful mathematical expression parser
- 💾 Efficient caching system
- 🔄 Event-driven architecture
src/
├── core/
│ ├── mod.rs # Core system functionality
│ └── parser.rs # Mathematical expression parser
└── algorithms/
└── graph.rs # Graph algorithms implementation
- Concurrency:
parking_lot
,crossbeam
,rayon
- Data Structures:
petgraph
,dashmap
- Numerics:
num-complex
- Error Handling:
thiserror
Add Graft to your Rust project with:
cargo add graft
use graft::algorithms::Grf;
fn main() {
// Initialize a new graph
let mut graph = Grf::new();
// Add nodes
graph.add_nd(1, 1.0, 0.0, 0.0);
graph.add_nd(2, 2.0, 1.0, 1.0);
// Add an edge
graph.add_ed(1, 2, 5.0);
// Calculate Minimum Spanning Tree (MST)
let mst = graph.mst();
println!("MST edges: {:?}", mst);
}
use graft::core::Core;
fn main() {
let core = Core::new(4); // Initialize with 4 worker threads
core.start();
// Perform concurrent operations here
core.stop();
}
Graft is optimized for:
- Efficient memory usage
- Safe, parallel concurrency
- High throughput for graph operations
We welcome contributions! Follow these steps to contribute:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/new-feature
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature/new-feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
Sazumi Viki - @moe.sazumiviki
🔗 Project Link: https://github.com/sazumivicky/graft
Special thanks to these amazing projects: