Skip to content

Commit

Permalink
Merge branch 'Karp' of https://github.com/cda-tum/mqt-qao into Karp
Browse files Browse the repository at this point in the history
  • Loading branch information
petarpetrovv committed Nov 22, 2024
2 parents 64a22f4 + 73c5a9a commit c07deb2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions docs/Karp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ KarpGraphs Class

Overview
--------
The **karp** module provides tools to solve and validate various NP-complete problems defined by Karp. The module is subdivided into three classes: **KarpGraphs**, **KarpSets**, and **KarpNumber**.
The **karp** module provides tools to solve and validate various NP-complete problems defined by Karp. The module is subdivided into three classes: **KarpGraphs**, **KarpSets**, and **KarpNumber**.

This document focuses on the KarpGraph class, which contains methods for solving graph-based problems, such as **graph coloring**, **vertex cover**, and **clique**. Among these, the ``graph_coloring`` method is detailed below.

Expand Down Expand Up @@ -43,10 +43,7 @@ This method sets up and optionally solves the graph coloring problem for a given
# Solve graph coloring for 2 colors
solution = KarpGraphs.graph_coloring(
input_data=G,
num_colors=2,
solve=True,
visualize=True
input_data=G, num_colors=2, solve=True, visualize=True
)
print(solution)
Expand Down Expand Up @@ -84,4 +81,4 @@ For a graph with vertices ``[1, 2, 3, 4]`` and solution:
Vertex: 3 Color: 1
Vertex: 4 Color: 2
The graph visualization highlights the node assignments with distinct colors.
The graph visualization highlights the node assignments with distinct colors.

0 comments on commit c07deb2

Please sign in to comment.