# qbsolv Input File Format¶

A .qubo file contains data that describes an unconstrained quadratic binary optimization problem. It is an ASCII file comprising four types of lines:

Comments defined by a “c” in column 1. Comments may appear anywhere in the file, and are ignored.

Program line defined by a “p” in the first column. A single program line must be the first non-comment line in the file. The program line has six required fields separated by space(s), as in this example:

p qubo topology maxNodes nNodes nCouplers

where:

p Problem line sentinel. qubo File type identifier. topology String that identifies the topology of the problem and the specific problem type. For an unconstrained problem, target is "0" or "unconstrained." In future implementations, valid strings might include "chimera128" or "chimera512" (among others). maxNodes Number of nodes in the topology. nNodes Number of nodes in the problem (nNodes <= maxNodes). Each node has a unique number and must take a value in the range {0 - (maxNodes-1)}. A duplicate node number is an error. Node numbers need not be in order, and need not be contiguous. nCouplers Number of couplers in the problem. Each coupler is a unique connection between two different nodes. The maximum number of couplers is (nNodes)^2. A duplicate coupler is an error.

nNodes clauses. Each clause is made up of three numbers, separated by one or more blanks. The first two numbers must be integers and are the number for this node (repeated). The node number must be in range {0 , (maxNodes-1)}. The third value is the weight associated with the node. Weight may be an integer or float, and can take on any positive or negative value, or be set to zero.

nCouplers clauses. Each clause is made up of three numbers, separated by one or more blanks. The first two numbers, (i and j), are the node numbers for this coupler and must be different integers, where (i < j).Each number must be one of the nNodes valid node numbers (and thus in range {0, (maxNodes-1)}). The third value is the strength associated with the coupler. Strength may be an integer or float, and can take on any positive or negative value, but not zero. Every node must connect with at least one other node (thus must have at least one coupler connected to it).

Here is a simple QUBO file example for an unconstrained QUBO with 4 nodes and 6 couplers. This example is provided to illustrate the elements of a QUBO benchmark file, not to represent a real problem.

```
| <--- column 1
c
c This is a sample .qubo file
c with 4 nodes and 6 couplers
c
p qubo 0 4 4 6
c ------------------
0 0 3.4
1 1 4.5
2 2 2.1
3 3 -2.4
c ------------------
0 1 2.2
0 2 3.4
1 2 4.5
0 3 -2
1 3 4.5678
2 3 -3.22
```