Skip to main content

cuenv_task_graph/
traversal.rs

1//! Traversal algorithms and types for task graphs.
2//!
3//! This module provides types and utilities for traversing task graphs
4//! in various orders.
5
6use crate::GraphNode;
7
8/// A topologically sorted sequence of task nodes.
9///
10/// This type represents tasks in an order where all dependencies
11/// come before the tasks that depend on them.
12pub type TopologicalOrder<T> = Vec<GraphNode<T>>;
13
14/// Groups of tasks that can execute in parallel.
15///
16/// Each inner vector contains tasks that have no dependencies on each other
17/// and can safely execute concurrently. The outer vector is ordered by
18/// dependency level - all tasks in group N must complete before tasks
19/// in group N+1 can start.
20pub type ParallelGroups<T> = Vec<Vec<GraphNode<T>>>;