competitive/graph/
mod.rs

1//! graph structures and algorithms
2
3use crate::{
4    algebra::{Monoid, SemiRing},
5    algorithm::BitDpExt,
6    num::{Bounded, One, Zero},
7    tools::{IterScan, MarkedIterScan, PartialIgnoredOrd},
8};
9
10#[codesnip::entry("AdjacencyListGraph")]
11pub use self::adjacency_list::{AdjacencyListGraph, AdjacencyListGraphScanner};
12#[codesnip::entry("BipartiteMatching")]
13pub use self::bipartite_matching::BipartiteMatching;
14#[codesnip::entry("ClosureGraph")]
15pub use self::closure::{ClosureGraph, UsizeGraph};
16#[codesnip::entry("dulmage_mendelsohn_decomposition")]
17pub use self::dulmage_mendelsohn_decomposition::dulmage_mendelsohn_decomposition;
18#[codesnip::entry("EdgeListGraph")]
19pub use self::edge_list::{EdgeListGraph, EdgeListGraphScanner};
20#[codesnip::entry("GraphBase")]
21pub use self::graph_base::*;
22#[codesnip::entry("GridGraph")]
23pub use self::grid::GridGraph;
24#[codesnip::entry("LowLink")]
25pub use self::low_link::LowLink;
26#[codesnip::entry("Dinic")]
27pub use self::maximum_flow::{Dinic, DinicBuilder};
28#[codesnip::entry("PrimalDual")]
29pub use self::minimum_cost_flow::{PrimalDual, PrimalDualBuilder};
30#[codesnip::entry("NetworkSimplex")]
31pub use self::network_simplex::NetworkSimplex;
32#[codesnip::entry("ProjectSelectionProblem")]
33pub use self::project_selection_problem::ProjectSelectionProblem;
34#[codesnip::entry("shortest_path")]
35pub use self::shortest_path::*;
36#[codesnip::entry("SparseGraph")]
37pub use self::sparse_graph::*;
38#[codesnip::entry("steiner_tree")]
39pub use self::steiner_tree::{SteinerTreeExt, SteinerTreeOutput};
40#[codesnip::entry("StronglyConnectedComponent")]
41pub use self::strongly_connected_component::StronglyConnectedComponent;
42#[codesnip::entry("TwoSatisfiability")]
43pub use self::two_satisfiability::TwoSatisfiability;
44
45#[cfg_attr(nightly, codesnip::entry("AdjacencyListGraph", include("scanner")))]
46mod adjacency_list;
47#[cfg_attr(nightly, codesnip::entry("BipartiteMatching"))]
48mod bipartite_matching;
49#[cfg_attr(nightly, codesnip::entry("ClosureGraph", include("GraphBase")))]
50mod closure;
51#[cfg_attr(
52    nightly,
53    codesnip::entry(
54        "dulmage_mendelsohn_decomposition",
55        include("BipartiteMatching", "StronglyConnectedComponent")
56    )
57)]
58mod dulmage_mendelsohn_decomposition;
59#[cfg_attr(nightly, codesnip::entry("EdgeListGraph", include("scanner")))]
60mod edge_list;
61#[cfg_attr(nightly, codesnip::entry("GraphBase"))]
62mod graph_base;
63#[cfg_attr(nightly, codesnip::entry("graphvis", include("SparseGraph")))]
64mod graphvis;
65#[cfg_attr(nightly, codesnip::entry("GridGraph", include("GraphBase")))]
66mod grid;
67#[cfg_attr(nightly, codesnip::entry("LowLink", include("SparseGraph")))]
68mod low_link;
69#[cfg_attr(
70    nightly,
71    codesnip::entry("Dinic", include("SparseGraph", "bounded", "zero_one"))
72)]
73mod maximum_flow;
74#[cfg_attr(nightly, codesnip::entry("PrimalDual", include("SparseGraph")))]
75mod minimum_cost_flow;
76mod minimum_spanning_tree;
77#[cfg_attr(nightly, codesnip::entry("NetworkSimplex", include("zero_one")))]
78mod network_simplex;
79mod order;
80#[cfg_attr(nightly, codesnip::entry("ProjectSelectionProblem", include("Dinic")))]
81mod project_selection_problem;
82#[cfg_attr(
83    nightly,
84    codesnip::entry(
85        "shortest_path",
86        include("GraphBase", "ring", "PartialIgnoredOrd", "bounded")
87    )
88)]
89mod shortest_path;
90#[cfg_attr(
91    nightly,
92    codesnip::entry("SparseGraph", include("scanner", "GraphBase"))
93)]
94mod sparse_graph;
95#[cfg_attr(
96    nightly,
97    codesnip::entry("steiner_tree", include("shortest_path", "BitDp"))
98)]
99mod steiner_tree;
100#[cfg_attr(
101    nightly,
102    codesnip::entry("StronglyConnectedComponent", include("SparseGraph"))
103)]
104mod strongly_connected_component;
105#[cfg_attr(nightly, codesnip::entry("topological_sort", include("SparseGraph")))]
106mod topological_sort;
107#[cfg_attr(
108    nightly,
109    codesnip::entry("TwoSatisfiability", include("StronglyConnectedComponent"))
110)]
111mod two_satisfiability;