Function create_commodities_graph_for_region_year

Source
fn create_commodities_graph_for_region_year(
    processes: &ProcessMap,
    region_id: &RegionID,
    year: u32,
) -> Graph<GraphNode, GraphEdge, Directed>
Expand description

Creates a directed graph of commodity flows for a given region and year.

The graph contains nodes for all commodities that may be consumed/produced by processes in the specified region/year. There will be an edge from commodity A to B if there exists a process that consumes A and produces B.

There are also special Source and Sink nodes, which are used for processes that have no inputs or outputs.

The graph does not take into account process availabilities or commodity demands, both of which can vary by time slice. See prepare_commodities_graph_for_validation.