Expand description
Graph-based optimization problems.
This module contains NP-hard problems defined on graphs:
IndependentSet: Maximum weight independent setMaximalIS: Maximal independent setVertexCovering: Minimum weight vertex coverDominatingSet: Minimum dominating setMaxCut: Maximum cut on weighted graphsColoring: K-vertex coloringMatching: Maximum weight matching
§Using the Template
New graph problems can be defined using the GraphProblem template by
implementing the GraphConstraint trait:
ⓘ
use problemreductions::models::graph::{GraphProblem, GraphConstraint};
// Define a new graph problem constraint
struct MyConstraint;
impl GraphConstraint for MyConstraint {
// ... implement required methods
}
// Create a type alias for convenience
type MyProblem<W = i32> = GraphProblem<MyConstraint, W>;Re-exports§
pub use template::CliqueConstraint;pub use template::CliqueT;pub use template::GraphConstraint;pub use template::GraphProblem;pub use template::IndependentSetConstraint;pub use template::IndependentSetT;pub use template::VertexCoverConstraint;pub use template::VertexCoverT;
Modules§
- template
- Generic graph problem template.
Structs§
- Coloring
- The Graph K-Coloring problem.
- Dominating
Set - The Dominating Set problem.
- Independent
Set - The Independent Set problem.
- Matching
- The Maximum Matching problem.
- MaxCut
- The Maximum Cut problem.
- MaximalIS
- The Maximal Independent Set problem.
- Vertex
Covering - The Vertex Covering problem.
Functions§
- cut_
size - Compute the cut size for a given partition.
- is_
dominating_ set - Check if a set of vertices is a dominating set.
- is_
independent_ set - Check if a set of vertices forms an independent set.
- is_
matching - Check if a selection of edges forms a valid matching.
- is_
maximal_ independent_ set - Check if a set is a maximal independent set.
- is_
valid_ coloring - Check if a coloring is valid for a graph.
- is_
vertex_ cover - Check if a set of vertices forms a vertex cover.