By Lunibyte team · · 6 min read

How the Resilience Lab Encodes a Network Planning Problem

The Resilience Lab starts with a concrete planning question and ends with a six-qubit circuit. This article walks through the encoding so a reader can see exactly which parts of the problem become variables, which become an objective, and which become a penalty.

The planning question

The network is a chain of six nodes: A–B–C–D–E–F. Five existing links form the chain. There are six candidate backup links (AC, BD, CE, DF, AD, CF). The task is to choose exactly two of those candidates. The score is the total pair-connectivity recovered across five separate single-link outage scenarios. Each outage has a weight equal to the number of node pairs that become disconnected when that chain edge fails. Overlaps are counted once. The maximum possible score is 35.

Decision variables and the budget constraint

Six binary variables x0…x5 indicate whether each candidate link is selected. The budget constraint is that the sum of the variables must equal 2. Any bitstring with a different number of 1s is infeasible. The lab does not hard-constrain the circuit to the feasible subspace; instead it adds a penalty term that raises the energy of infeasible selections.

From coverage to QUBO to Ising

The objective to minimize is written as E = −coverage + 36(Σx − 2)². The first term rewards higher coverage. The second term is zero only when exactly two links are chosen and grows quickly otherwise. This expression is a quadratic unconstrained binary optimization (QUBO). The lab then maps the QUBO onto an Ising Hamiltonian whose diagonal elements are the energies of the 64 computational-basis states. Phase-separation gates in the QAOA circuit apply those energies as phases. A mixer of RX rotations on each qubit explores the space.

What the circuit does and does not enforce

Because the penalty is soft, some measured shots will still be infeasible. The lab leaves those shots visible in the sample table and does not replace them with the classical optimum. A feasible shot’s coverage is computed from the same outage weights used by the classical baseline. The energy shown for every bitstring is the value of the Ising objective, so a reader can see both the planning score and the constraint penalty in one place.

The encoding is fixed for this prototype. Changing the number of candidates, the budget, or the outage weights would require a different QUBO and a different circuit. The current lab shows one transparent instance of that process, not a general network planner.