Skip to content

Results are limited to Maximum Independent Set v0.0.1

Product news
You are reading Maximum Independent Set v0.0.1, an older version of this documentation. Go to the latest version (v0.3.2)

Usage

from mis import MISSolver, MISInstance
import networkx as nx
# Generate a simple graph (triangle)
graph = nx.Graph()
graph.add_edges_from([(0, 1), (0, 2)])
# Create an instance for the solver
instance = MISInstance(graph)
# Solve the MIS problem
results = MISSolver.solve(instance)
print("MIS solution:", results.solution)
print("Solution cost:", results.cost)