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

  1. Basic Graph Operations - Your first graph and fundamental operations
  2. Simple Pathfinding - Using Dijkstra and A* for shortest paths
  3. Working with Different State Types - Custom states and indexing

Intermediate Level

  1. Custom Cost Types - Multi-criteria optimization and lexicographic costs
  2. Thread-Safe Searches - Concurrent pathfinding with SearchContext
  3. Performance Optimization - Pre-allocation, batch operations, and profiling

Advanced Level

  1. Grid-Based Pathfinding - 2D/3D grids for games and robotics
  2. Real-World Applications - GPS navigation, game AI, network analysis
  3. Extending the Library - Custom algorithms and advanced patterns

Tutorial Goals

Each tutorial builds on previous concepts while introducing new features:

Prerequisites

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

Tutorial Format

Each tutorial follows a consistent structure:

  1. Learning Objectives - What you’ll accomplish
  2. Complete Example - Working code you can run
  3. Step-by-Step Explanation - How each part works
  4. Key Concepts - Important principles to remember
  5. Exercises - Practice problems to reinforce learning
  6. Next Steps - Preview of upcoming tutorials

Additional Resources


Ready to start? Begin with Tutorial 1: Basic Graph Operations