I am trying to find the minimum cut for a given graph. I am using QAOA and refering to the qiskit textbook: https://qiskit.org/textbook/ch-applications/qaoa.html. I understand I need to find the minimum eigenvalue.
I am confused on 2 main points:
- How the graph is connected to the circuit, we change it to a bit string and then parameterize it with the unitary Rx ...?
- how this maxcut def works so how can I change it to mincut?
Still working on understanding what max/min cut is.
def maxcut_obj(x, G): """ Given a bitstring as a solution, this function returns the number of edges shared between the two partitions of the graph.
Args:
x: str
solution bitstring
G: networkx graph
Returns:
obj: float
Objective
"""
obj = 0
for i, j in G.edges():
if x[i] != x[j]:
obj -= 1
return obj