libgraph
C++ class templates for graph construction and search
Project maintained by rxdu
Hosted on GitHub Pages — Theme by mattgraham
libgraph Tutorial Series
A progressive learning path from basic graphs to advanced features.
Learning Path
Beginner Level
- Basic Graph Operations - Your first graph and fundamental operations
- Simple Pathfinding - Using Dijkstra and A* for shortest paths
- Working with Different State Types - Custom states and indexing
- Custom Cost Types - Multi-criteria optimization and lexicographic costs
- Thread-Safe Searches - Concurrent pathfinding with SearchContext
- Performance Optimization - Pre-allocation, batch operations, and profiling
Advanced Level
- Grid-Based Pathfinding - 2D/3D grids for games and robotics
- Real-World Applications - GPS navigation, game AI, network analysis
- Extending the Library - Custom algorithms and advanced patterns
Tutorial Goals
Each tutorial builds on previous concepts while introducing new features:
- Hands-on examples you can run immediately
- Progressive complexity from basic to advanced use cases
- Real-world applications showing practical usage patterns
- Best practices for performance and maintainability
- Common pitfalls and how to avoid them
Prerequisites
- Basic C++ knowledge (classes, templates, STL containers)
- CMake basics for building examples
- Familiarity with graph concepts (vertices, edges, paths)
Quick Setup
Before starting the tutorials, set up your environment:
# Clone and build the library
git clone https://github.com/rxdu/libgraph.git
cd libgraph
mkdir build && cd build
cmake -DBUILD_TESTING=ON ..
cmake --build .
# Run the first example to verify setup
./bin/simple_graph_demo
Each tutorial follows a consistent structure:
- Learning Objectives - What you’ll accomplish
- Complete Example - Working code you can run
- Step-by-Step Explanation - How each part works
- Key Concepts - Important principles to remember
- Exercises - Practice problems to reinforce learning
- Next Steps - Preview of upcoming tutorials
Additional Resources
Ready to start? Begin with Tutorial 1: Basic Graph Operations