IndependentSetT

Type Alias IndependentSetT 

Source
pub type IndependentSetT<G = SimpleGraph, W = i32> = GraphProblem<IndependentSetConstraint, G, W>;
Expand description

Independent Set problem using the generic template.

Find a maximum weight set of vertices where no two are adjacent.

§Type Parameters

  • G: Graph type (default: SimpleGraph)
  • W: Weight type (default: i32)

§Examples

use problemreductions::models::graph::IndependentSetT;
use problemreductions::topology::{SimpleGraph, UnitDiskGraph};

// Default: SimpleGraph
let is = IndependentSetT::new(4, vec![(0, 1), (1, 2)]);

// With UnitDiskGraph for quantum hardware
let udg = UnitDiskGraph::new(positions, radius);
let is_udg = IndependentSetT::<UnitDiskGraph>::from_graph(udg);

Aliased Type§

pub struct IndependentSetT<G = SimpleGraph, W = i32> { /* private fields */ }