Skip to main content

Cut a graph in two, then check the cut.

Split a graph's vertices into two sides so that as much edge weight as possible crosses between them, and check the cut against the graph.

Each vertex goes to one side or the other. The cut is the weight of the edges that cross between the sides: the larger, the better. Written as an Ising problem, the largest cut is the lowest energy, and solvers built for Ising problems search for it.

The engine is the browser build of commit 9888b97d5229; this page checks its file's SHA-256 before it runs. Nothing you solve here is sent anywhere.

Make a graph, or paste one, and pick a method.

A generated graph joins each pair of vertices with the chance you give, from a seed, so the same seed gives the same graph. A pasted graph is one edge a line, i j or i j w with vertices from 0, or a graph in the G-set text form.

The graph

The same graph by each method.

Simulated bifurcation (discrete and ballistic) and simulated annealing on the graph above, at the steps and trials above, and every assignment where the graph has 24 vertices or fewer. Only every assignment claims the best cut.

How a cut becomes an energy, and how it is checked.

  1. The graph becomes an Ising problem. Each vertex is a spin, +1 on one side and −1 on the other; each edge of weight w couples its two spins with J = −w. The energy of an assignment is E = Σ w·si·sj over the edges.
  2. A larger cut is a lower energy. An edge within one side adds w and an edge across subtracts it, so cut = (total weight − E) / 2.
  3. The engine searches. Simulated bifurcation moves every spin at once along a smooth path that settles on ±1; annealing flips one spin at a time and cools; every assignment tries all 2n. Each run is seeded, so the same request gives the same answer on every machine.
  4. The answer is checked. This page sums the cut again from the edges; the engine's verifier makes the problem's digest again and sums the state's energy again, bit for bit; and the receipt is checked. That proves the energy stated is the state's. Only every assignment proves no lower energy exists.

Solve the same graph on your own machine.

The command line at the same commit takes the same request and gives the same answer, sealed with its own key. With Rust installed through rustup:

git clone https://git.transaction.science/Transaction-Science/open-standards
cd open-standards
git checkout 9888b97d5229674f5038bad6da9d1fa7fb3d251c
cd wai/wai-quantum-cli
echo '{"maxcut":{"n":5,"edges":[[0,1],[1,2],[2,3],[3,4],[4,0],[0,2,2]]},"method":"exact"}' > job.json
cargo run --release --bin wai-quantum -- lab qio --seal --request job.json --demo-key --json

The request's every member is in the guide to Ising and sampling jobs: a QUBO, a spin glass or a G-set graph in place of the edges, and each method's settings. This page's engine was built with rustc 1.100.0 and wasm-pack 0.15.0; its file's SHA-256 is 12808555bc0d5084941e56acfba3a97efa0afd20cbb6a6c29d57403ed63bdd74.

Where to go from here