globmp/gridstart reorganized: init.py holds INIT (Algorithm 3) and the plain grid only, instance.py the instance and the exact piece test, exact_repair.py the repair step and GlobMP with it; READMEs point to Algorithm 3
Browse files- README.md +2 -2
- globmp/gridstart/README.md +5 -4
- globmp/gridstart/__init__.py +1 -1
- globmp/gridstart/exact_repair.py +18 -0
- globmp/gridstart/init.py +14 -244
- globmp/gridstart/instance.py +222 -0
- globmp/gridstart/reference/optimum.json +151 -151
- globmp/gridstart/reference/summary.json +177 -177
- globmp/gridstart/run.py +10 -6
README.md
CHANGED
|
@@ -29,7 +29,7 @@ globmp/ the method (pip install -e .)
|
|
| 29 |
check.py exact continuous-time feasibility check
|
| 30 |
seed.py initial curves from waypoints
|
| 31 |
synthetic/ Section 4.1: robots exchanging places among spheres (2 to 200 robots)
|
| 32 |
-
gridstart/
|
| 33 |
tests/ fast unit tests
|
| 34 |
applications/
|
| 35 |
multi_robot/ Section 4.2 and appendix: multi-robot planning
|
|
@@ -74,7 +74,7 @@ continuity `C^ell_j` at junctions.
|
|
| 74 |
| paper | code | check against the paper's runs |
|
| 75 |
|---|---|---|
|
| 76 |
| Sec. 4.1, Figs. 2-3 (pairs of robots among spheres, 2 to 200 robots; RRT-Connect, RRT*, GCS, SDP-MP) | `globmp/synthetic/` | first-order Algorithm 2 on all 2472 route classes, every curve exactly certified feasible; per-instance cost matches the paper (median ratio 1.00000, all 80 instances within 1% or cheaper); baselines bit-identical; 200 robots on CPU: 65 restoration iterations in 70 s (paper 71 s) |
|
| 77 |
-
|
|
| 78 |
| Sec. 4.2 and appendix (Robotarium arena; simulated suite) | `applications/multi_robot/robotarium/`, `applications/multi_robot/multi_robot_extension/` | suite cells: same success, path length to 3e-5; Robotarium: saved plans rescored to the paper's numbers on all 20 cells |
|
| 79 |
| appendix (Maze2D) | `applications/maze2d/` | score, success and violations identical; plans match the figure data to 1e-11 |
|
| 80 |
| Sec. 4.3 (steering dexterous policies) | `applications/steering/` | robot-side code not included yet |
|
|
|
|
| 29 |
check.py exact continuous-time feasibility check
|
| 30 |
seed.py initial curves from waypoints
|
| 31 |
synthetic/ Section 4.1: robots exchanging places among spheres (2 to 200 robots)
|
| 32 |
+
gridstart/ Section 3, Algorithm 3 (INIT): the grid start of Theorem 1 by a shortest path over the joints
|
| 33 |
tests/ fast unit tests
|
| 34 |
applications/
|
| 35 |
multi_robot/ Section 4.2 and appendix: multi-robot planning
|
|
|
|
| 74 |
| paper | code | check against the paper's runs |
|
| 75 |
|---|---|---|
|
| 76 |
| Sec. 4.1, Figs. 2-3 (pairs of robots among spheres, 2 to 200 robots; RRT-Connect, RRT*, GCS, SDP-MP) | `globmp/synthetic/` | first-order Algorithm 2 on all 2472 route classes, every curve exactly certified feasible; per-instance cost matches the paper (median ratio 1.00000, all 80 instances within 1% or cheaper); baselines bit-identical; 200 robots on CPU: 65 restoration iterations in 70 s (paper 71 s) |
|
| 77 |
+
| Sec. 3, Algorithm 3 (INIT, the grid start of Theorem 1) and its appendix table | `globmp/gridstart/` | same start as the plain grid in 27 of 27 cases; 16 free coordinates, 5.9e18 grid points: 208,929 exact piece tests |
|
| 78 |
| Sec. 4.2 and appendix (Robotarium arena; simulated suite) | `applications/multi_robot/robotarium/`, `applications/multi_robot/multi_robot_extension/` | suite cells: same success, path length to 3e-5; Robotarium: saved plans rescored to the paper's numbers on all 20 cells |
|
| 79 |
| appendix (Maze2D) | `applications/maze2d/` | score, success and violations identical; plans match the figure data to 1e-11 |
|
| 80 |
| Sec. 4.3 (steering dexterous policies) | `applications/steering/` | robot-side code not included yet |
|
globmp/gridstart/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
Theorem 1 starts GlobMP from `z_h`, the cheapest feasible point of a grid of spacing `h` in the free control
|
| 4 |
-
points. Algorithm
|
| 5 |
per joint, a piece is determined by the values at its two ends, the cost is a sum over the pieces, and a curve is
|
| 6 |
feasible exactly when every piece is. INIT is the shortest path over the joints; it tests single pieces exactly and
|
| 7 |
skips a piece when the cost so far plus the piece cost exceeds a budget `U` (the cost of a known feasible curve).
|
|
@@ -14,8 +14,9 @@ four route classes.
|
|
| 14 |
|
| 15 |
| file | content |
|
| 16 |
|---|---|
|
| 17 |
-
| `init.py` |
|
| 18 |
-
| `
|
|
|
|
| 19 |
| `run.py` | sanity checks, `E*_N`, one job per `(N, h)`, summary table |
|
| 20 |
| `reference/` | `optimum.json` and `summary.json` of the run below |
|
| 21 |
|
|
|
|
| 1 |
+
# INIT: the grid start by a shortest path over the joints (Algorithm 3)
|
| 2 |
|
| 3 |
Theorem 1 starts GlobMP from `z_h`, the cheapest feasible point of a grid of spacing `h` in the free control
|
| 4 |
+
points. INIT (Algorithm 3, Section 3) computes the same `z_h` without listing the grid: the grid is a product of finite sets, one
|
| 5 |
per joint, a piece is determined by the values at its two ends, the cost is a sum over the pieces, and a curve is
|
| 6 |
feasible exactly when every piece is. INIT is the shortest path over the joints; it tests single pieces exactly and
|
| 7 |
skips a piece when the cost so far plus the piece cost exceeds a budget `U` (the cost of a known feasible curve).
|
|
|
|
| 14 |
|
| 15 |
| file | content |
|
| 16 |
|---|---|
|
| 17 |
+
| `init.py` | INIT (`init`; comments give the line numbers of Algorithm 3) and the plain grid (`plain_grid`) |
|
| 18 |
+
| `instance.py` | the instance, the chart of free control points, the cost, the exact test of one piece |
|
| 19 |
+
| `exact_repair.py` | the exact repair step (5) as a semidefinite program (Clarabel), and GlobMP with that repair |
|
| 20 |
| `run.py` | sanity checks, `E*_N`, one job per `(N, h)`, summary table |
|
| 21 |
| `reference/` | `optimum.json` and `summary.json` of the run below |
|
| 22 |
|
globmp/gridstart/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"""
|
|
|
|
| 1 |
+
"""INIT (Algorithm 3): the grid start of Theorem 1 by a shortest path over the joints, against the plain grid."""
|
globmp/gridstart/exact_repair.py
CHANGED
|
@@ -121,3 +121,21 @@ def exact_repair(p, z, y, settings=None):
|
|
| 121 |
info = dict(status=status, t_build=t1 - t0, t_solve=t2 - t1, t_total=t2 - t0, iters=its, passes=passes,
|
| 122 |
nblocks=int(pi.shape[0]), eq_res=eqres)
|
| 123 |
return w, info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
info = dict(status=status, t_build=t1 - t0, t_solve=t2 - t1, t_total=t2 - t0, iters=its, passes=passes,
|
| 122 |
nblocks=int(pi.shape[0]), eq_res=eqres)
|
| 123 |
return w, info
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def exact_descent(p, Z, eta=None, maxit=3000, tol=1e-7, start_repair=False):
|
| 127 |
+
"""GlobMP with the exact repair: z+ = argmin_{w in C(z)} 1/2 ||w - (z - eta grad f(z))||^2, eta = 1/beta."""
|
| 128 |
+
eta = 1.0 / p.beta if eta is None else eta
|
| 129 |
+
t0 = time.time(); Z = torch.as_tensor(Z, dtype=DT)
|
| 130 |
+
if start_repair:
|
| 131 |
+
w, info0 = exact_repair(p, Z, Z)
|
| 132 |
+
if w is None: return None, dict(start_empty=True, time=time.time() - t0)
|
| 133 |
+
Z = w
|
| 134 |
+
costs = [float(p.cost(Z))]; it = 0; fails = 0
|
| 135 |
+
for it in range(maxit):
|
| 136 |
+
y = Z - eta * p.cost_grad(Z)
|
| 137 |
+
w, info = exact_repair(p, Z, y)
|
| 138 |
+
if w is None: fails += 1; break
|
| 139 |
+
step = float((w - Z).norm()); Z = w; costs.append(float(p.cost(Z)))
|
| 140 |
+
if step < tol: break
|
| 141 |
+
return Z, dict(start_empty=False, iters=it + 1, final_cost=costs[-1], time=time.time() - t0, fails=fails)
|
globmp/gridstart/init.py
CHANGED
|
@@ -1,195 +1,17 @@
|
|
| 1 |
-
"""
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
Free control points (the paper's rational chart), 4N numbers:
|
| 9 |
-
x = [ c0 | (a_1, Q_1) | ... | (a_{N-1}, Q_{N-1}) | a_N ]
|
| 10 |
-
c0 = second control point of piece 0, Q_j = position at joint j, a_j = control point just before joint j.
|
| 11 |
-
Piece i has control points (Q_i, o_i, a_{i+1}, Q_{i+1}) with Q_0 = START, Q_N = GOAL, o_0 = c0, o_i = 2 Q_i - a_i
|
| 12 |
-
(C^1 with equal piece durations; an integer map, so the grid h Z^{4N} is a product over the joints).
|
| 13 |
-
Time scale: the package gives every piece unit duration, so cost(total duration 1) = N^3 * cost(package).
|
| 14 |
"""
|
| 15 |
-
import math
|
| 16 |
import time
|
| 17 |
|
| 18 |
import numpy as np
|
| 19 |
-
import torch
|
| 20 |
-
|
| 21 |
-
from .. import Problem, DT
|
| 22 |
-
from .. import spline as bern
|
| 23 |
-
from ..check import block_minima
|
| 24 |
-
from .exact_repair import exact_repair
|
| 25 |
-
|
| 26 |
-
torch.set_num_threads(1)
|
| 27 |
-
|
| 28 |
-
START = np.array([0.0, 0.0]); GOAL = np.array([10.0, 0.0])
|
| 29 |
-
DISCS = [((3.3, 0.25), 1.0), ((6.7, -0.35), 1.0)]
|
| 30 |
-
DELTA = 0.005
|
| 31 |
-
D = 3
|
| 32 |
-
K4 = bern.cost_gram(D, 2).numpy() # 4x4 Gram of the acceleration cost of one piece
|
| 33 |
-
CD = np.array([math.comb(D, j) for j in range(D + 1)], float)
|
| 34 |
-
C2 = np.array([math.comb(2 * D, j) for j in range(2 * D + 1)], float)
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
def build(N, whiten=False, bb=False, stop_rel=1e-10):
|
| 38 |
-
p = Problem(2, D, 2, 0, N, START, GOAL, ell_j=1, delta=DELTA, whiten=whiten, bb=bb, stop_rel=stop_rel)
|
| 39 |
-
for c, r in DISCS: p.add_sphere(c, r)
|
| 40 |
-
return p
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
# ------------------------------------------------------------------ chart
|
| 44 |
-
def idx_joint(j, N):
|
| 45 |
-
"""x indices of the state at joint j (0: c0, N: a_N, else (a_j, Q_j))."""
|
| 46 |
-
if j == 0: return [0, 1]
|
| 47 |
-
if j == N: return [4 * N - 2, 4 * N - 1]
|
| 48 |
-
return list(range(2 + 4 * (j - 1), 6 + 4 * (j - 1)))
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
def ctrl(x, N):
|
| 52 |
-
"""x (..., 4N) -> control points (..., N, 4, 2)."""
|
| 53 |
-
x = np.asarray(x, float); lead = x.shape[:-1]
|
| 54 |
-
C = np.zeros(lead + (N, 4, 2))
|
| 55 |
-
Q = [np.broadcast_to(START, lead + (2,))]; a = [None]
|
| 56 |
-
for j in range(1, N):
|
| 57 |
-
ij = idx_joint(j, N); a.append(x[..., ij[0]:ij[0] + 2]); Q.append(x[..., ij[0] + 2:ij[0] + 4])
|
| 58 |
-
a.append(x[..., 4 * N - 2:4 * N]); Q.append(np.broadcast_to(GOAL, lead + (2,)))
|
| 59 |
-
for i in range(N):
|
| 60 |
-
o = x[..., 0:2] if i == 0 else 2 * Q[i] - a[i]
|
| 61 |
-
C[..., i, 0, :] = Q[i]; C[..., i, 1, :] = o; C[..., i, 2, :] = a[i + 1]; C[..., i, 3, :] = Q[i + 1]
|
| 62 |
-
return C
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
def x_to_G(x, N):
|
| 66 |
-
C = ctrl(x, N) # (N,4,2)
|
| 67 |
-
return np.transpose(C, (2, 0, 1)).reshape(2, N * 4)
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
def G_to_Z(p, G):
|
| 71 |
-
"""chart point of a coefficient matrix that satisfies the linear constraints (any chart, also whitened)."""
|
| 72 |
-
R = (torch.as_tensor(G, dtype=DT) - p.Gamma0)
|
| 73 |
-
Z = torch.linalg.lstsq(p.N, R.T).solution.T
|
| 74 |
-
assert float((p.Gamma(Z) - torch.as_tensor(G, dtype=DT)).abs().max()) < 1e-8, 'G violates the linear constraints'
|
| 75 |
-
return Z
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
def Z_to_x(p, Z, N):
|
| 79 |
-
S = p.segs(torch.as_tensor(Z, dtype=DT)).detach().numpy() # (N, 2, 4)
|
| 80 |
-
x = np.zeros(4 * N); x[0:2] = S[0, :, 1]
|
| 81 |
-
for j in range(1, N):
|
| 82 |
-
ij = idx_joint(j, N); x[ij[0]:ij[0] + 2] = S[j - 1, :, 2]; x[ij[0] + 2:ij[0] + 4] = S[j - 1, :, 3]
|
| 83 |
-
x[4 * N - 2:] = S[N - 1, :, 2]
|
| 84 |
-
return x
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
class Quad:
|
| 88 |
-
"""f(x) = c + 2 g.x + x^T H x for the whole curve and for every suffix of pieces (cost-to-go bounds)."""
|
| 89 |
-
|
| 90 |
-
def __init__(self, N):
|
| 91 |
-
self.N = N; m = 4 * N
|
| 92 |
-
C0 = ctrl(np.zeros(m), N); J = np.stack([ctrl(e, N) - C0 for e in np.eye(m)], -1) # (N,4,2,m)
|
| 93 |
-
self.C0, self.J = C0, J
|
| 94 |
-
self.c, self.g, self.H = self._quad(range(N))
|
| 95 |
-
Hi = np.linalg.inv(self.H); self.xs = -Hi @ self.g; self.fmin = self.c + self.g @ self.xs; self.Hi = Hi
|
| 96 |
-
self.togo_data = {}
|
| 97 |
-
for j in range(N):
|
| 98 |
-
c, g, H = self._quad(range(j, N)); s = idx_joint(j, N); r = list(range(s[-1] + 1, m))
|
| 99 |
-
Hrr_i = np.linalg.inv(H[np.ix_(r, r)])
|
| 100 |
-
self.togo_data[j] = (c, g[s], H[np.ix_(s, s)], g[r], H[np.ix_(r, s)], Hrr_i)
|
| 101 |
-
|
| 102 |
-
def _quad(self, pieces):
|
| 103 |
-
pieces = list(pieces); C0 = self.C0[pieces]; J = self.J[pieces]
|
| 104 |
-
H = np.einsum('pq,ipcm,iqcn->mn', K4, J, J); g = np.einsum('pq,ipc,iqcn->n', K4, C0, J)
|
| 105 |
-
return float(np.einsum('pq,ipc,iqc->', K4, C0, C0)), g, H
|
| 106 |
|
| 107 |
-
|
| 108 |
-
x = np.asarray(x, float); return self.c + 2 * x @ self.g + np.einsum('...m,mn,...n->...', x, self.H, x)
|
| 109 |
|
| 110 |
-
def togo(self, j, S):
|
| 111 |
-
"""lower bound on the cost of pieces j..N-1 from state S (K, dim) at joint j (unconstrained minimum)."""
|
| 112 |
-
if j == self.N: return np.zeros(len(S))
|
| 113 |
-
c, gs, Hss, gr, Hrs, Hrr_i = self.togo_data[j]
|
| 114 |
-
v = gr[None, :] + S @ Hrs.T
|
| 115 |
-
return c + 2 * S @ gs + np.einsum('km,mn,kn->k', S, Hss, S) - np.einsum('km,mn,kn->k', v, Hrr_i, v)
|
| 116 |
|
| 117 |
-
def sublevel_count(self, U, h):
|
| 118 |
-
"""volume of the ellipsoid {f <= U} divided by h^m: estimate of the number of lattice points with f <= U."""
|
| 119 |
-
m = 4 * self.N; ev = np.linalg.eigvalsh(self.H)
|
| 120 |
-
logv = 0.5 * m * math.log(math.pi) - math.lgamma(0.5 * m + 1) + 0.5 * m * math.log(max(U - self.fmin, 1e-300)) - 0.5 * np.log(ev).sum()
|
| 121 |
-
return math.exp(logv - m * math.log(h))
|
| 122 |
-
|
| 123 |
-
def box(self, U, h):
|
| 124 |
-
"""integer ranges (lo, hi) per coordinate of the lattice h Z^m inside the bounding box of {f <= U}."""
|
| 125 |
-
half = np.sqrt(max(U - self.fmin, 0.0) * np.diag(self.Hi))
|
| 126 |
-
lo = np.ceil((self.xs - half) / h - 1e-12).astype(int); hi = np.floor((self.xs + half) / h + 1e-12).astype(int)
|
| 127 |
-
return lo, hi
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
# ------------------------------------------------------------------ exact piece test
|
| 131 |
-
def piece_coefs(B):
|
| 132 |
-
"""control points (K,4,2) -> Bernstein-6 coefficients (K, n_discs, 7) of |x(s)-c|^2 - (r+DELTA)^2."""
|
| 133 |
-
K = B.shape[0]; out = []
|
| 134 |
-
for c, r in DISCS:
|
| 135 |
-
A = (B - np.array(c)[None, None, :]) * CD[None, :, None]
|
| 136 |
-
prod = np.zeros((K, 2 * D + 1))
|
| 137 |
-
for a in range(D + 1):
|
| 138 |
-
prod[:, a:a + D + 1] += (A[:, a:a + 1, :] * A).sum(-1)
|
| 139 |
-
out.append(prod / C2 - (r + DELTA) ** 2)
|
| 140 |
-
return np.stack(out, 1)
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
def _split(c):
|
| 144 |
-
"""de Casteljau at 1/2: (m,7) -> left (m,7), right (m,7)."""
|
| 145 |
-
m, n = c.shape; L = np.empty_like(c); R = np.empty_like(c); cur = c.copy()
|
| 146 |
-
for j in range(n):
|
| 147 |
-
L[:, j] = cur[:, 0]; R[:, n - 1 - j] = cur[:, -1]
|
| 148 |
-
cur = 0.5 * (cur[:, :-1] + cur[:, 1:])
|
| 149 |
-
return L, R
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
def _exact_min(c):
|
| 153 |
-
"""minimum over [0,1] of a polynomial given by Bernstein coefficients (roots of the derivative)."""
|
| 154 |
-
n = len(c) - 1
|
| 155 |
-
pw = np.zeros(n + 1) # power basis, increasing degree
|
| 156 |
-
for j in range(n + 1):
|
| 157 |
-
for i in range(j, n + 1):
|
| 158 |
-
pw[i] += c[j] * math.comb(n, j) * math.comb(n - j, i - j) * (-1) ** (i - j)
|
| 159 |
-
P = np.polynomial.Polynomial(pw); cand = [0.0, 1.0]
|
| 160 |
-
for r in P.deriv().roots():
|
| 161 |
-
if abs(r.imag) < 1e-9 and 0.0 <= r.real <= 1.0: cand.append(r.real)
|
| 162 |
-
return min(float(P(t)) for t in cand)
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
def nonneg(Bc, depth=40):
|
| 166 |
-
"""Bc (K,7): True where the polynomial is >= 0 on [0,1]. Nonnegative Bernstein coefficients certify, a
|
| 167 |
-
negative end value refutes, otherwise bisect; what is still undecided at the depth limit (tangent cases)
|
| 168 |
-
goes to the derivative-root minimisation. Returns (bool (K,), number of root fallbacks)."""
|
| 169 |
-
K = len(Bc); res = np.ones(K, bool); idx = np.arange(K); cur = Bc
|
| 170 |
-
for _ in range(depth):
|
| 171 |
-
neg = (cur[:, 0] < 0) | (cur[:, -1] < 0)
|
| 172 |
-
res[idx[neg]] = False
|
| 173 |
-
und = ~neg & ~(cur >= 0).all(1) & res[idx]
|
| 174 |
-
if not und.any(): return res, 0
|
| 175 |
-
cur = cur[und]; idx = idx[und]
|
| 176 |
-
L, R = _split(cur); cur = np.concatenate([L, R]); idx = np.concatenate([idx, idx])
|
| 177 |
-
left = np.unique(idx[res[idx]])
|
| 178 |
-
for j in left: res[j] = _exact_min(Bc[j]) >= 0
|
| 179 |
-
return res, len(left)
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
def pieces_free(B):
|
| 183 |
-
"""control points (K,4,2) -> True where the piece clears every inflated disc on its whole interval."""
|
| 184 |
-
Bc = piece_coefs(B); ok = np.ones(len(B), bool); nfb = 0
|
| 185 |
-
for b in range(Bc.shape[1]):
|
| 186 |
-
sel = np.where(ok)[0]
|
| 187 |
-
if len(sel) == 0: break
|
| 188 |
-
r, f = nonneg(Bc[sel, b]); ok[sel] = r; nfb += f
|
| 189 |
-
return ok, nfb
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
# ------------------------------------------------------------------ INIT
|
| 193 |
def _lattice(lo, hi, h):
|
| 194 |
ax = [np.arange(l, u + 1) * h for l, u in zip(lo, hi)]
|
| 195 |
return np.stack(np.meshgrid(*ax, indexing='ij'), -1).reshape(-1, len(ax))
|
|
@@ -206,8 +28,8 @@ def _pair_cost_parts(Sq, So, Ta, Tq):
|
|
| 206 |
return ws, wt, uK.reshape(len(u), 4), v.reshape(len(v), 4)
|
| 207 |
|
| 208 |
|
| 209 |
-
def
|
| 210 |
-
"""
|
| 211 |
rule 'togo': skip when V(s) + w + togo(s') > U and drop states with V(s) + togo(s) > U, where togo is the
|
| 212 |
obstacle-free cost of the remaining pieces (a lower bound, so the output is the same). improve_only: also
|
| 213 |
skip pairs that cannot lower the current V(s') (same output). Returns the cheapest feasible grid point x
|
|
@@ -230,20 +52,21 @@ def init_dp(N, h, U, rule='budget', improve_only=False, chunk_entries=2e7, verbo
|
|
| 230 |
order = np.argsort(V, kind='stable'); cs = max(1, int(chunk_entries // max(1, len(T))))
|
| 231 |
for b in range(0, len(order), cs):
|
| 232 |
si = order[b:b + cs]
|
| 233 |
-
tot = V[si][:, None] + ws[si][:, None] + wt[None, :] + 2 * uK[si] @ vf.T
|
| 234 |
-
mask = tot + tg[None, :] <= Ue
|
| 235 |
st['budget_pass'] += int(mask.sum())
|
| 236 |
if improve_only: mask &= tot < Vn[None, :]
|
| 237 |
a, t = np.nonzero(mask)
|
| 238 |
if len(a) == 0: continue
|
| 239 |
B = np.stack([Sq[si][a], So[si][a], Ta[t], Tq[t]], 1)
|
| 240 |
-
ok, nfb = pieces_free(B)
|
|
|
|
| 241 |
a, t = a[ok], t[ok]
|
| 242 |
if len(a) == 0: continue
|
| 243 |
val = tot[a, t]
|
| 244 |
o2 = np.lexsort((val, t)); t2 = t[o2]; first = np.r_[True, t2[1:] != t2[:-1]]
|
| 245 |
tt = t2[first]; vv = val[o2][first]; aa = si[a[o2][first]]
|
| 246 |
-
better = vv < Vn[tt]; Vn[tt[better]] = vv[better]; pr[tt[better]] = aa[better]
|
| 247 |
live = np.isfinite(Vn)
|
| 248 |
st.update(live_targets=int(live.sum()), time=time.time() - tl); layers.append(st)
|
| 249 |
if verbose: print(f' N{N} h{h} piece {i}: {st}', flush=True)
|
|
@@ -262,7 +85,7 @@ def init_dp(N, h, U, rule='budget', improve_only=False, chunk_entries=2e7, verbo
|
|
| 262 |
budget_pass=sum(l['budget_pass'] for l in layers), box=[(int(a), int(b)) for a, b in zip(lo, hi)])
|
| 263 |
|
| 264 |
|
| 265 |
-
def
|
| 266 |
"""The plain grid: every lattice point of the box of {f <= U} with f <= U gets a whole-curve test. Returns
|
| 267 |
the cheapest feasible one (or None), its cost, and the counts."""
|
| 268 |
q = Quad(N); lo, hi = q.box(U, h); m = 4 * N; t0 = time.time(); Ue = U * (1 + 1e-12)
|
|
@@ -296,56 +119,3 @@ def brute_grid(N, h, U, chunk_entries=2e7):
|
|
| 296 |
for a_, b_ in zip(lo, hi): npts *= int(b_ - a_ + 1)
|
| 297 |
return best[1], (best[0] if best[1] is not None else None), dict(grid_points_box=npts, grid_points_sublevel=n_in,
|
| 298 |
whole_curve_tests=n_test, time=time.time() - t0)
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
# ------------------------------------------------------------------ descents and checks
|
| 302 |
-
def exact_descent(p, Z, eta=None, maxit=3000, tol=1e-7, start_repair=False):
|
| 303 |
-
"""GlobMP with the exact repair: z+ = argmin_{w in C(z)} 1/2 ||w - (z - eta grad f(z))||^2, eta = 1/beta."""
|
| 304 |
-
eta = 1.0 / p.beta if eta is None else eta
|
| 305 |
-
t0 = time.time(); Z = torch.as_tensor(Z, dtype=DT)
|
| 306 |
-
if start_repair:
|
| 307 |
-
w, info0 = exact_repair(p, Z, Z)
|
| 308 |
-
if w is None: return None, dict(start_empty=True, time=time.time() - t0)
|
| 309 |
-
Z = w
|
| 310 |
-
costs = [float(p.cost(Z))]; it = 0; fails = 0
|
| 311 |
-
for it in range(maxit):
|
| 312 |
-
y = Z - eta * p.cost_grad(Z)
|
| 313 |
-
w, info = exact_repair(p, Z, y)
|
| 314 |
-
if w is None: fails += 1; break
|
| 315 |
-
step = float((w - Z).norm()); Z = w; costs.append(float(p.cost(Z)))
|
| 316 |
-
if step < tol: break
|
| 317 |
-
return Z, dict(start_empty=False, iters=it + 1, final_cost=costs[-1], time=time.time() - t0, fails=fails)
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
def side_of(p, Z):
|
| 321 |
-
"""route class: side of each disc at the curve's closest approach ('p' above the centre)."""
|
| 322 |
-
S = p.segs(torch.as_tensor(Z, dtype=DT)).detach().numpy() # (N,2,4)
|
| 323 |
-
s = np.linspace(0, 1, 801); i = np.arange(D + 1)
|
| 324 |
-
Bm = CD[:, None] * s[None, :] ** i[:, None] * (1 - s[None, :]) ** (D - i[:, None])
|
| 325 |
-
pts = np.concatenate([S[k] @ Bm for k in range(S.shape[0])], 1) # (2, N*801)
|
| 326 |
-
out = []
|
| 327 |
-
for c, r in DISCS:
|
| 328 |
-
dd = (pts[0] - c[0]) ** 2 + (pts[1] - c[1]) ** 2; t = int(np.argmin(dd)); out.append('p' if pts[1, t] > c[1] else 'm')
|
| 329 |
-
return ''.join(out)
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
def certify_true(p, Z):
|
| 333 |
-
"""exact rational checker (globmp.synthetic.exact) at the true radii, no margin."""
|
| 334 |
-
from ..synthetic.exact.certify_curve import Plan, check_plan
|
| 335 |
-
from fractions import Fraction
|
| 336 |
-
spec = dict(spheres=[([0, 1], (Fraction(c[0]).limit_denominator(1000), Fraction(c[1]).limit_denominator(1000)),
|
| 337 |
-
Fraction(r).limit_denominator(1000)) for c, r in DISCS])
|
| 338 |
-
segs = p.segs(torch.as_tensor(Z, dtype=DT)).detach().numpy()
|
| 339 |
-
return bool(check_plan(Plan(segs), spec, clearance=False)['certified'])
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
def subdivide_cubic(P4, N):
|
| 343 |
-
"""one cubic with control points P4 (4,2) -> coefficient matrix (2, 4N) of the same curve cut into N equal pieces."""
|
| 344 |
-
from numpy.polynomial import polynomial as Pl
|
| 345 |
-
out = np.zeros((2, 4 * N)); s = np.array([0.0, 1 / 3, 2 / 3, 1.0])
|
| 346 |
-
i = np.arange(4); Bm = lambda t: CD[:, None] * t[None, :] ** i[:, None] * (1 - t[None, :]) ** (3 - i[:, None])
|
| 347 |
-
Minv = np.linalg.inv(Bm(s)) # values at 4 nodes -> control points
|
| 348 |
-
for k in range(N):
|
| 349 |
-
t = (k + s) / N; vals = P4.T @ Bm(t) # (2,4) values of the big cubic at the piece's nodes
|
| 350 |
-
out[:, 4 * k:4 * k + 4] = vals @ Minv
|
| 351 |
-
return out
|
|
|
|
| 1 |
+
"""INIT (Algorithm 3 of the paper): the grid start z_h of Theorem 1 by a shortest path over the joints, and the
|
| 2 |
+
plain grid it replaces.
|
| 3 |
|
| 4 |
+
The grid h Z^{4N} in the free control points is a product of finite sets, one per joint. A piece is determined by
|
| 5 |
+
the values at its two ends, the cost is a sum over the pieces, and a curve is feasible exactly when every piece
|
| 6 |
+
is. `init` keeps, for every grid value at a joint, the cheapest feasible way to reach it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"""
|
|
|
|
| 8 |
import time
|
| 9 |
|
| 10 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
from .instance import GOAL, START, K4, Quad, ctrl, idx_joint, pieces_free
|
|
|
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
def _lattice(lo, hi, h):
|
| 16 |
ax = [np.arange(l, u + 1) * h for l, u in zip(lo, hi)]
|
| 17 |
return np.stack(np.meshgrid(*ax, indexing='ij'), -1).reshape(-1, len(ax))
|
|
|
|
| 28 |
return ws, wt, uK.reshape(len(u), 4), v.reshape(len(v), 4)
|
| 29 |
|
| 30 |
|
| 31 |
+
def init(N, h, U, rule='budget', improve_only=False, chunk_entries=2e7, verbose=False):
|
| 32 |
+
"""INIT. rule 'budget' (the rule of the paper's algorithm box): skip a pair when V(s) + w > U.
|
| 33 |
rule 'togo': skip when V(s) + w + togo(s') > U and drop states with V(s) + togo(s) > U, where togo is the
|
| 34 |
obstacle-free cost of the remaining pieces (a lower bound, so the output is the same). improve_only: also
|
| 35 |
skip pairs that cannot lower the current V(s') (same output). Returns the cheapest feasible grid point x
|
|
|
|
| 52 |
order = np.argsort(V, kind='stable'); cs = max(1, int(chunk_entries // max(1, len(T))))
|
| 53 |
for b in range(0, len(order), cs):
|
| 54 |
si = order[b:b + cs]
|
| 55 |
+
tot = V[si][:, None] + ws[si][:, None] + wt[None, :] + 2 * uK[si] @ vf.T # V(s) + w (line 3)
|
| 56 |
+
mask = tot + tg[None, :] <= Ue # budget rule (line 4)
|
| 57 |
st['budget_pass'] += int(mask.sum())
|
| 58 |
if improve_only: mask &= tot < Vn[None, :]
|
| 59 |
a, t = np.nonzero(mask)
|
| 60 |
if len(a) == 0: continue
|
| 61 |
B = np.stack([Sq[si][a], So[si][a], Ta[t], Tq[t]], 1)
|
| 62 |
+
ok, nfb = pieces_free(B) # exact test (line 5)
|
| 63 |
+
st['tested'] += len(a); st['free'] += int(ok.sum()); st['root_fallback'] += nfb
|
| 64 |
a, t = a[ok], t[ok]
|
| 65 |
if len(a) == 0: continue
|
| 66 |
val = tot[a, t]
|
| 67 |
o2 = np.lexsort((val, t)); t2 = t[o2]; first = np.r_[True, t2[1:] != t2[:-1]]
|
| 68 |
tt = t2[first]; vv = val[o2][first]; aa = si[a[o2][first]]
|
| 69 |
+
better = vv < Vn[tt]; Vn[tt[better]] = vv[better]; pr[tt[better]] = aa[better] # update V(s') (line 6)
|
| 70 |
live = np.isfinite(Vn)
|
| 71 |
st.update(live_targets=int(live.sum()), time=time.time() - tl); layers.append(st)
|
| 72 |
if verbose: print(f' N{N} h{h} piece {i}: {st}', flush=True)
|
|
|
|
| 85 |
budget_pass=sum(l['budget_pass'] for l in layers), box=[(int(a), int(b)) for a, b in zip(lo, hi)])
|
| 86 |
|
| 87 |
|
| 88 |
+
def plain_grid(N, h, U, chunk_entries=2e7):
|
| 89 |
"""The plain grid: every lattice point of the box of {f <= U} with f <= U gets a whole-curve test. Returns
|
| 90 |
the cheapest feasible one (or None), its cost, and the counts."""
|
| 91 |
q = Quad(N); lo, hi = q.box(U, h); m = 4 * N; t0 = time.time(); Ue = U * (1 + 1e-12)
|
|
|
|
| 119 |
for a_, b_ in zip(lo, hi): npts *= int(b_ - a_ + 1)
|
| 120 |
return best[1], (best[0] if best[1] is not None else None), dict(grid_points_box=npts, grid_points_sublevel=n_in,
|
| 121 |
whole_curve_tests=n_test, time=time.time() - t0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
globmp/gridstart/instance.py
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The grid-start instance: one robot in the plane passes two discs; start (0,0), goal (10,0); acceleration cost
|
| 2 |
+
(k = 2), endpoint positions fixed (ell = 0), inflation margin 0.005; N cubic pieces on equal intervals joined C^1
|
| 3 |
+
(the class S_N of Theorem 1).
|
| 4 |
+
|
| 5 |
+
Free control points (the paper's rational chart), 4N numbers:
|
| 6 |
+
x = [ c0 | (a_1, Q_1) | ... | (a_{N-1}, Q_{N-1}) | a_N ]
|
| 7 |
+
c0 = second control point of piece 0, Q_j = position at joint j, a_j = control point just before joint j.
|
| 8 |
+
Piece i has control points (Q_i, o_i, a_{i+1}, Q_{i+1}) with Q_0 = START, Q_N = GOAL, o_0 = c0, o_i = 2 Q_i - a_i
|
| 9 |
+
(C^1 with equal piece durations; an integer map, so the grid h Z^{4N} is a product over the joints).
|
| 10 |
+
Time scale: the package gives every piece unit duration, so cost(total duration 1) = N^3 * cost(package).
|
| 11 |
+
|
| 12 |
+
Contents: the program (`build`), the chart, the cost as a quadratic (`Quad`), the exact test of one piece
|
| 13 |
+
(`pieces_free`), route classes, and the exact rational check of a whole curve.
|
| 14 |
+
"""
|
| 15 |
+
import math
|
| 16 |
+
|
| 17 |
+
import numpy as np
|
| 18 |
+
import torch
|
| 19 |
+
|
| 20 |
+
from .. import Problem, DT
|
| 21 |
+
from .. import spline as bern
|
| 22 |
+
from ..check import block_minima
|
| 23 |
+
|
| 24 |
+
torch.set_num_threads(1)
|
| 25 |
+
|
| 26 |
+
START = np.array([0.0, 0.0]); GOAL = np.array([10.0, 0.0])
|
| 27 |
+
DISCS = [((3.3, 0.25), 1.0), ((6.7, -0.35), 1.0)]
|
| 28 |
+
DELTA = 0.005
|
| 29 |
+
D = 3
|
| 30 |
+
K4 = bern.cost_gram(D, 2).numpy() # 4x4 Gram of the acceleration cost of one piece
|
| 31 |
+
CD = np.array([math.comb(D, j) for j in range(D + 1)], float)
|
| 32 |
+
C2 = np.array([math.comb(2 * D, j) for j in range(2 * D + 1)], float)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def build(N, whiten=False, bb=False, stop_rel=1e-10):
|
| 36 |
+
p = Problem(2, D, 2, 0, N, START, GOAL, ell_j=1, delta=DELTA, whiten=whiten, bb=bb, stop_rel=stop_rel)
|
| 37 |
+
for c, r in DISCS: p.add_sphere(c, r)
|
| 38 |
+
return p
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
# ------------------------------------------------------------------ chart
|
| 42 |
+
def idx_joint(j, N):
|
| 43 |
+
"""x indices of the state at joint j (0: c0, N: a_N, else (a_j, Q_j))."""
|
| 44 |
+
if j == 0: return [0, 1]
|
| 45 |
+
if j == N: return [4 * N - 2, 4 * N - 1]
|
| 46 |
+
return list(range(2 + 4 * (j - 1), 6 + 4 * (j - 1)))
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def ctrl(x, N):
|
| 50 |
+
"""x (..., 4N) -> control points (..., N, 4, 2)."""
|
| 51 |
+
x = np.asarray(x, float); lead = x.shape[:-1]
|
| 52 |
+
C = np.zeros(lead + (N, 4, 2))
|
| 53 |
+
Q = [np.broadcast_to(START, lead + (2,))]; a = [None]
|
| 54 |
+
for j in range(1, N):
|
| 55 |
+
ij = idx_joint(j, N); a.append(x[..., ij[0]:ij[0] + 2]); Q.append(x[..., ij[0] + 2:ij[0] + 4])
|
| 56 |
+
a.append(x[..., 4 * N - 2:4 * N]); Q.append(np.broadcast_to(GOAL, lead + (2,)))
|
| 57 |
+
for i in range(N):
|
| 58 |
+
o = x[..., 0:2] if i == 0 else 2 * Q[i] - a[i]
|
| 59 |
+
C[..., i, 0, :] = Q[i]; C[..., i, 1, :] = o; C[..., i, 2, :] = a[i + 1]; C[..., i, 3, :] = Q[i + 1]
|
| 60 |
+
return C
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def x_to_G(x, N):
|
| 64 |
+
C = ctrl(x, N) # (N,4,2)
|
| 65 |
+
return np.transpose(C, (2, 0, 1)).reshape(2, N * 4)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def G_to_Z(p, G):
|
| 69 |
+
"""chart point of a coefficient matrix that satisfies the linear constraints (any chart, also whitened)."""
|
| 70 |
+
R = (torch.as_tensor(G, dtype=DT) - p.Gamma0)
|
| 71 |
+
Z = torch.linalg.lstsq(p.N, R.T).solution.T
|
| 72 |
+
assert float((p.Gamma(Z) - torch.as_tensor(G, dtype=DT)).abs().max()) < 1e-8, 'G violates the linear constraints'
|
| 73 |
+
return Z
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def Z_to_x(p, Z, N):
|
| 77 |
+
S = p.segs(torch.as_tensor(Z, dtype=DT)).detach().numpy() # (N, 2, 4)
|
| 78 |
+
x = np.zeros(4 * N); x[0:2] = S[0, :, 1]
|
| 79 |
+
for j in range(1, N):
|
| 80 |
+
ij = idx_joint(j, N); x[ij[0]:ij[0] + 2] = S[j - 1, :, 2]; x[ij[0] + 2:ij[0] + 4] = S[j - 1, :, 3]
|
| 81 |
+
x[4 * N - 2:] = S[N - 1, :, 2]
|
| 82 |
+
return x
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
class Quad:
|
| 86 |
+
"""f(x) = c + 2 g.x + x^T H x for the whole curve and for every suffix of pieces (cost-to-go bounds)."""
|
| 87 |
+
|
| 88 |
+
def __init__(self, N):
|
| 89 |
+
self.N = N; m = 4 * N
|
| 90 |
+
C0 = ctrl(np.zeros(m), N); J = np.stack([ctrl(e, N) - C0 for e in np.eye(m)], -1) # (N,4,2,m)
|
| 91 |
+
self.C0, self.J = C0, J
|
| 92 |
+
self.c, self.g, self.H = self._quad(range(N))
|
| 93 |
+
Hi = np.linalg.inv(self.H); self.xs = -Hi @ self.g; self.fmin = self.c + self.g @ self.xs; self.Hi = Hi
|
| 94 |
+
self.togo_data = {}
|
| 95 |
+
for j in range(N):
|
| 96 |
+
c, g, H = self._quad(range(j, N)); s = idx_joint(j, N); r = list(range(s[-1] + 1, m))
|
| 97 |
+
Hrr_i = np.linalg.inv(H[np.ix_(r, r)])
|
| 98 |
+
self.togo_data[j] = (c, g[s], H[np.ix_(s, s)], g[r], H[np.ix_(r, s)], Hrr_i)
|
| 99 |
+
|
| 100 |
+
def _quad(self, pieces):
|
| 101 |
+
pieces = list(pieces); C0 = self.C0[pieces]; J = self.J[pieces]
|
| 102 |
+
H = np.einsum('pq,ipcm,iqcn->mn', K4, J, J); g = np.einsum('pq,ipc,iqcn->n', K4, C0, J)
|
| 103 |
+
return float(np.einsum('pq,ipc,iqc->', K4, C0, C0)), g, H
|
| 104 |
+
|
| 105 |
+
def f(self, x):
|
| 106 |
+
x = np.asarray(x, float); return self.c + 2 * x @ self.g + np.einsum('...m,mn,...n->...', x, self.H, x)
|
| 107 |
+
|
| 108 |
+
def togo(self, j, S):
|
| 109 |
+
"""lower bound on the cost of pieces j..N-1 from state S (K, dim) at joint j (unconstrained minimum)."""
|
| 110 |
+
if j == self.N: return np.zeros(len(S))
|
| 111 |
+
c, gs, Hss, gr, Hrs, Hrr_i = self.togo_data[j]
|
| 112 |
+
v = gr[None, :] + S @ Hrs.T
|
| 113 |
+
return c + 2 * S @ gs + np.einsum('km,mn,kn->k', S, Hss, S) - np.einsum('km,mn,kn->k', v, Hrr_i, v)
|
| 114 |
+
|
| 115 |
+
def sublevel_count(self, U, h):
|
| 116 |
+
"""volume of the ellipsoid {f <= U} divided by h^m: estimate of the number of lattice points with f <= U."""
|
| 117 |
+
m = 4 * self.N; ev = np.linalg.eigvalsh(self.H)
|
| 118 |
+
logv = 0.5 * m * math.log(math.pi) - math.lgamma(0.5 * m + 1) + 0.5 * m * math.log(max(U - self.fmin, 1e-300)) - 0.5 * np.log(ev).sum()
|
| 119 |
+
return math.exp(logv - m * math.log(h))
|
| 120 |
+
|
| 121 |
+
def box(self, U, h):
|
| 122 |
+
"""integer ranges (lo, hi) per coordinate of the lattice h Z^m inside the bounding box of {f <= U}."""
|
| 123 |
+
half = np.sqrt(max(U - self.fmin, 0.0) * np.diag(self.Hi))
|
| 124 |
+
lo = np.ceil((self.xs - half) / h - 1e-12).astype(int); hi = np.floor((self.xs + half) / h + 1e-12).astype(int)
|
| 125 |
+
return lo, hi
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
# ------------------------------------------------------------------ exact piece test
|
| 129 |
+
def piece_coefs(B):
|
| 130 |
+
"""control points (K,4,2) -> Bernstein-6 coefficients (K, n_discs, 7) of |x(s)-c|^2 - (r+DELTA)^2."""
|
| 131 |
+
K = B.shape[0]; out = []
|
| 132 |
+
for c, r in DISCS:
|
| 133 |
+
A = (B - np.array(c)[None, None, :]) * CD[None, :, None]
|
| 134 |
+
prod = np.zeros((K, 2 * D + 1))
|
| 135 |
+
for a in range(D + 1):
|
| 136 |
+
prod[:, a:a + D + 1] += (A[:, a:a + 1, :] * A).sum(-1)
|
| 137 |
+
out.append(prod / C2 - (r + DELTA) ** 2)
|
| 138 |
+
return np.stack(out, 1)
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def _split(c):
|
| 142 |
+
"""de Casteljau at 1/2: (m,7) -> left (m,7), right (m,7)."""
|
| 143 |
+
m, n = c.shape; L = np.empty_like(c); R = np.empty_like(c); cur = c.copy()
|
| 144 |
+
for j in range(n):
|
| 145 |
+
L[:, j] = cur[:, 0]; R[:, n - 1 - j] = cur[:, -1]
|
| 146 |
+
cur = 0.5 * (cur[:, :-1] + cur[:, 1:])
|
| 147 |
+
return L, R
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def _exact_min(c):
|
| 151 |
+
"""minimum over [0,1] of a polynomial given by Bernstein coefficients (roots of the derivative)."""
|
| 152 |
+
n = len(c) - 1
|
| 153 |
+
pw = np.zeros(n + 1) # power basis, increasing degree
|
| 154 |
+
for j in range(n + 1):
|
| 155 |
+
for i in range(j, n + 1):
|
| 156 |
+
pw[i] += c[j] * math.comb(n, j) * math.comb(n - j, i - j) * (-1) ** (i - j)
|
| 157 |
+
P = np.polynomial.Polynomial(pw); cand = [0.0, 1.0]
|
| 158 |
+
for r in P.deriv().roots():
|
| 159 |
+
if abs(r.imag) < 1e-9 and 0.0 <= r.real <= 1.0: cand.append(r.real)
|
| 160 |
+
return min(float(P(t)) for t in cand)
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
def nonneg(Bc, depth=40):
|
| 164 |
+
"""Bc (K,7): True where the polynomial is >= 0 on [0,1]. Nonnegative Bernstein coefficients certify, a
|
| 165 |
+
negative end value refutes, otherwise bisect; what is still undecided at the depth limit (tangent cases)
|
| 166 |
+
goes to the derivative-root minimisation. Returns (bool (K,), number of root fallbacks)."""
|
| 167 |
+
K = len(Bc); res = np.ones(K, bool); idx = np.arange(K); cur = Bc
|
| 168 |
+
for _ in range(depth):
|
| 169 |
+
neg = (cur[:, 0] < 0) | (cur[:, -1] < 0)
|
| 170 |
+
res[idx[neg]] = False
|
| 171 |
+
und = ~neg & ~(cur >= 0).all(1) & res[idx]
|
| 172 |
+
if not und.any(): return res, 0
|
| 173 |
+
cur = cur[und]; idx = idx[und]
|
| 174 |
+
L, R = _split(cur); cur = np.concatenate([L, R]); idx = np.concatenate([idx, idx])
|
| 175 |
+
left = np.unique(idx[res[idx]])
|
| 176 |
+
for j in left: res[j] = _exact_min(Bc[j]) >= 0
|
| 177 |
+
return res, len(left)
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
def pieces_free(B):
|
| 181 |
+
"""control points (K,4,2) -> True where the piece clears every inflated disc on its whole interval."""
|
| 182 |
+
Bc = piece_coefs(B); ok = np.ones(len(B), bool); nfb = 0
|
| 183 |
+
for b in range(Bc.shape[1]):
|
| 184 |
+
sel = np.where(ok)[0]
|
| 185 |
+
if len(sel) == 0: break
|
| 186 |
+
r, f = nonneg(Bc[sel, b]); ok[sel] = r; nfb += f
|
| 187 |
+
return ok, nfb
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
# ------------------------------------------------------------------ route classes and checks
|
| 191 |
+
def side_of(p, Z):
|
| 192 |
+
"""route class: side of each disc at the curve's closest approach ('p' above the centre)."""
|
| 193 |
+
S = p.segs(torch.as_tensor(Z, dtype=DT)).detach().numpy() # (N,2,4)
|
| 194 |
+
s = np.linspace(0, 1, 801); i = np.arange(D + 1)
|
| 195 |
+
Bm = CD[:, None] * s[None, :] ** i[:, None] * (1 - s[None, :]) ** (D - i[:, None])
|
| 196 |
+
pts = np.concatenate([S[k] @ Bm for k in range(S.shape[0])], 1) # (2, N*801)
|
| 197 |
+
out = []
|
| 198 |
+
for c, r in DISCS:
|
| 199 |
+
dd = (pts[0] - c[0]) ** 2 + (pts[1] - c[1]) ** 2; t = int(np.argmin(dd)); out.append('p' if pts[1, t] > c[1] else 'm')
|
| 200 |
+
return ''.join(out)
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
def certify_true(p, Z):
|
| 204 |
+
"""exact rational checker (globmp.synthetic.exact) at the true radii, no margin."""
|
| 205 |
+
from ..synthetic.exact.certify_curve import Plan, check_plan
|
| 206 |
+
from fractions import Fraction
|
| 207 |
+
spec = dict(spheres=[([0, 1], (Fraction(c[0]).limit_denominator(1000), Fraction(c[1]).limit_denominator(1000)),
|
| 208 |
+
Fraction(r).limit_denominator(1000)) for c, r in DISCS])
|
| 209 |
+
segs = p.segs(torch.as_tensor(Z, dtype=DT)).detach().numpy()
|
| 210 |
+
return bool(check_plan(Plan(segs), spec, clearance=False)['certified'])
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
def subdivide_cubic(P4, N):
|
| 214 |
+
"""one cubic with control points P4 (4,2) -> coefficient matrix (2, 4N) of the same curve cut into N equal pieces."""
|
| 215 |
+
from numpy.polynomial import polynomial as Pl
|
| 216 |
+
out = np.zeros((2, 4 * N)); s = np.array([0.0, 1 / 3, 2 / 3, 1.0])
|
| 217 |
+
i = np.arange(4); Bm = lambda t: CD[:, None] * t[None, :] ** i[:, None] * (1 - t[None, :]) ** (3 - i[:, None])
|
| 218 |
+
Minv = np.linalg.inv(Bm(s)) # values at 4 nodes -> control points
|
| 219 |
+
for k in range(N):
|
| 220 |
+
t = (k + s) / N; vals = P4.T @ Bm(t) # (2,4) values of the big cubic at the piece's nodes
|
| 221 |
+
out[:, 4 * k:4 * k + 4] = vals @ Minv
|
| 222 |
+
return out
|
globmp/gridstart/reference/optimum.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
"start_empty": false,
|
| 5 |
"iters": 379,
|
| 6 |
"final_cost": 123.4334411701152,
|
| 7 |
-
"time": 1.
|
| 8 |
"fails": 0,
|
| 9 |
"side": "pp",
|
| 10 |
"cert": true,
|
|
@@ -20,7 +20,7 @@
|
|
| 20 |
"start_empty": false,
|
| 21 |
"iters": 55,
|
| 22 |
"final_cost": 3380.4405236729945,
|
| 23 |
-
"time": 0.
|
| 24 |
"fails": 0,
|
| 25 |
"side": "pm",
|
| 26 |
"cert": true,
|
|
@@ -36,7 +36,7 @@
|
|
| 36 |
"start_empty": false,
|
| 37 |
"iters": 343,
|
| 38 |
"final_cost": 1104.1591755871814,
|
| 39 |
-
"time": 1.
|
| 40 |
"fails": 0,
|
| 41 |
"side": "mp",
|
| 42 |
"cert": true,
|
|
@@ -52,7 +52,7 @@
|
|
| 52 |
"start_empty": false,
|
| 53 |
"iters": 3000,
|
| 54 |
"final_cost": 143.51204097823734,
|
| 55 |
-
"time": 14.
|
| 56 |
"fails": 0,
|
| 57 |
"side": "mm",
|
| 58 |
"cert": true,
|
|
@@ -69,69 +69,69 @@
|
|
| 69 |
"2": {
|
| 70 |
"pp": {
|
| 71 |
"start_empty": false,
|
| 72 |
-
"iters":
|
| 73 |
-
"final_cost": 12.
|
| 74 |
-
"time":
|
| 75 |
"fails": 0,
|
| 76 |
"side": "pp",
|
| 77 |
"cert": true,
|
| 78 |
-
"min_block_inflated":
|
| 79 |
"x": [
|
| 80 |
-
1.
|
| 81 |
-
0.
|
| 82 |
-
3.
|
| 83 |
-
1.
|
| 84 |
-
4.
|
| 85 |
-
1.
|
| 86 |
-
8.
|
| 87 |
-
0.
|
| 88 |
]
|
| 89 |
},
|
| 90 |
"pm": {
|
| 91 |
"start_empty": false,
|
| 92 |
-
"iters":
|
| 93 |
-
"final_cost": 256.
|
| 94 |
-
"time":
|
| 95 |
"fails": 0,
|
| 96 |
"side": "pm",
|
| 97 |
"cert": true,
|
| 98 |
-
"min_block_inflated":
|
| 99 |
"x": [
|
| 100 |
-
2.
|
| 101 |
-
1.
|
| 102 |
-
3.
|
| 103 |
-
1.
|
| 104 |
-
5.
|
| 105 |
-
-0.
|
| 106 |
-
7.
|
| 107 |
-
-1.
|
| 108 |
]
|
| 109 |
},
|
| 110 |
"mp": {
|
| 111 |
"start_empty": false,
|
| 112 |
-
"iters":
|
| 113 |
-
"final_cost": 77.
|
| 114 |
-
"time":
|
| 115 |
"fails": 0,
|
| 116 |
"side": "mp",
|
| 117 |
"cert": true,
|
| 118 |
-
"min_block_inflated": 6.
|
| 119 |
"x": [
|
| 120 |
-
1.
|
| 121 |
-
-0.
|
| 122 |
-
3.
|
| 123 |
-
-1.
|
| 124 |
-
4.
|
| 125 |
-
-0.
|
| 126 |
-
8.
|
| 127 |
-
0.
|
| 128 |
]
|
| 129 |
},
|
| 130 |
"mm": {
|
| 131 |
"start_empty": false,
|
| 132 |
"iters": 3000,
|
| 133 |
"final_cost": 14.311050159679098,
|
| 134 |
-
"time": 20.
|
| 135 |
"fails": 0,
|
| 136 |
"side": "mm",
|
| 137 |
"cert": true,
|
|
@@ -147,38 +147,38 @@
|
|
| 147 |
-0.845732640193367
|
| 148 |
]
|
| 149 |
},
|
| 150 |
-
"E_star": 12.
|
| 151 |
},
|
| 152 |
"3": {
|
| 153 |
"pp": {
|
| 154 |
"start_empty": false,
|
| 155 |
"iters": 22,
|
| 156 |
-
"final_cost": 3.
|
| 157 |
-
"time": 0.
|
| 158 |
"fails": 0,
|
| 159 |
"side": "pp",
|
| 160 |
"cert": true,
|
| 161 |
-
"min_block_inflated": 1.
|
| 162 |
"x": [
|
| 163 |
-
1.
|
| 164 |
-
0.
|
| 165 |
-
2.
|
| 166 |
-
1.
|
| 167 |
-
3.
|
| 168 |
-
1.
|
| 169 |
-
5.
|
| 170 |
-
1.
|
| 171 |
-
6.
|
| 172 |
-
1.
|
| 173 |
-
8.
|
| 174 |
-
0.
|
| 175 |
]
|
| 176 |
},
|
| 177 |
"pm": {
|
| 178 |
"start_empty": false,
|
| 179 |
"iters": 20,
|
| 180 |
"final_cost": 58.478341676860964,
|
| 181 |
-
"time": 0.
|
| 182 |
"fails": 0,
|
| 183 |
"side": "pm",
|
| 184 |
"cert": true,
|
|
@@ -201,87 +201,87 @@
|
|
| 201 |
"mp": {
|
| 202 |
"start_empty": false,
|
| 203 |
"iters": 44,
|
| 204 |
-
"final_cost": 17.
|
| 205 |
-
"time": 0.
|
| 206 |
"fails": 0,
|
| 207 |
"side": "mp",
|
| 208 |
"cert": true,
|
| 209 |
-
"min_block_inflated": -
|
| 210 |
"x": [
|
| 211 |
-
1.
|
| 212 |
-
-0.
|
| 213 |
-
2.
|
| 214 |
-
-0.
|
| 215 |
-
3.
|
| 216 |
-
-0.
|
| 217 |
-
5.
|
| 218 |
-
0.
|
| 219 |
-
6.
|
| 220 |
-
0.
|
| 221 |
-
8.
|
| 222 |
-
0.
|
| 223 |
]
|
| 224 |
},
|
| 225 |
"mm": {
|
| 226 |
"start_empty": false,
|
| 227 |
"iters": 35,
|
| 228 |
-
"final_cost": 4.
|
| 229 |
-
"time": 0.
|
| 230 |
"fails": 0,
|
| 231 |
"side": "mm",
|
| 232 |
"cert": true,
|
| 233 |
-
"min_block_inflated": 1.
|
| 234 |
"x": [
|
| 235 |
-
1.
|
| 236 |
-
-0.
|
| 237 |
-
2.
|
| 238 |
-
-0.
|
| 239 |
-
3.
|
| 240 |
-
-1.
|
| 241 |
-
5.
|
| 242 |
-
-1.
|
| 243 |
-
6.
|
| 244 |
-
-1.
|
| 245 |
-
9.
|
| 246 |
-
-0.
|
| 247 |
]
|
| 248 |
},
|
| 249 |
-
"E_star": 3.
|
| 250 |
},
|
| 251 |
"4": {
|
| 252 |
"pp": {
|
| 253 |
"start_empty": false,
|
| 254 |
-
"iters":
|
| 255 |
-
"final_cost": 1.
|
| 256 |
-
"time":
|
| 257 |
"fails": 0,
|
| 258 |
"side": "pp",
|
| 259 |
"cert": true,
|
| 260 |
-
"min_block_inflated": 6.
|
| 261 |
"x": [
|
| 262 |
-
0.
|
| 263 |
-
0.
|
| 264 |
-
1.
|
| 265 |
-
0.
|
| 266 |
-
2.
|
| 267 |
-
1.
|
| 268 |
-
3.
|
| 269 |
-
1.
|
| 270 |
-
4.
|
| 271 |
-
1.
|
| 272 |
-
6.
|
| 273 |
-
1.
|
| 274 |
-
7.
|
| 275 |
-
0.
|
| 276 |
-
9.
|
| 277 |
-
0.
|
| 278 |
]
|
| 279 |
},
|
| 280 |
"pm": {
|
| 281 |
"start_empty": false,
|
| 282 |
"iters": 30,
|
| 283 |
"final_cost": 25.135662384660918,
|
| 284 |
-
"time": 0.
|
| 285 |
"fails": 0,
|
| 286 |
"side": "pm",
|
| 287 |
"cert": true,
|
|
@@ -307,60 +307,60 @@
|
|
| 307 |
},
|
| 308 |
"mp": {
|
| 309 |
"start_empty": false,
|
| 310 |
-
"iters":
|
| 311 |
-
"final_cost": 7.
|
| 312 |
-
"time":
|
| 313 |
"fails": 0,
|
| 314 |
"side": "mp",
|
| 315 |
"cert": true,
|
| 316 |
-
"min_block_inflated":
|
| 317 |
"x": [
|
| 318 |
-
0.
|
| 319 |
-
-0.
|
| 320 |
-
1.
|
| 321 |
-
-0.
|
| 322 |
-
2.
|
| 323 |
-
-0.
|
| 324 |
-
4.
|
| 325 |
-
-0.
|
| 326 |
-
4.
|
| 327 |
-
-0.
|
| 328 |
-
6.
|
| 329 |
-
0.
|
| 330 |
-
7.
|
| 331 |
-
0.
|
| 332 |
-
9.
|
| 333 |
-
0.
|
| 334 |
]
|
| 335 |
},
|
| 336 |
"mm": {
|
| 337 |
"start_empty": false,
|
| 338 |
-
"iters":
|
| 339 |
-
"final_cost": 1.
|
| 340 |
-
"time":
|
| 341 |
"fails": 0,
|
| 342 |
"side": "mm",
|
| 343 |
"cert": true,
|
| 344 |
-
"min_block_inflated":
|
| 345 |
"x": [
|
| 346 |
-
0.
|
| 347 |
-
-0.
|
| 348 |
-
1.
|
| 349 |
-
-0.
|
| 350 |
-
2.
|
| 351 |
-
-0.
|
| 352 |
-
4.
|
| 353 |
-
-1.
|
| 354 |
-
5.
|
| 355 |
-
-1.
|
| 356 |
-
6.
|
| 357 |
-
-1.
|
| 358 |
-
7.
|
| 359 |
-
-1.
|
| 360 |
-
9.
|
| 361 |
-
-0.
|
| 362 |
]
|
| 363 |
},
|
| 364 |
-
"E_star": 1.
|
| 365 |
}
|
| 366 |
}
|
|
|
|
| 4 |
"start_empty": false,
|
| 5 |
"iters": 379,
|
| 6 |
"final_cost": 123.4334411701152,
|
| 7 |
+
"time": 1.818354606628418,
|
| 8 |
"fails": 0,
|
| 9 |
"side": "pp",
|
| 10 |
"cert": true,
|
|
|
|
| 20 |
"start_empty": false,
|
| 21 |
"iters": 55,
|
| 22 |
"final_cost": 3380.4405236729945,
|
| 23 |
+
"time": 0.2730109691619873,
|
| 24 |
"fails": 0,
|
| 25 |
"side": "pm",
|
| 26 |
"cert": true,
|
|
|
|
| 36 |
"start_empty": false,
|
| 37 |
"iters": 343,
|
| 38 |
"final_cost": 1104.1591755871814,
|
| 39 |
+
"time": 1.7831926345825195,
|
| 40 |
"fails": 0,
|
| 41 |
"side": "mp",
|
| 42 |
"cert": true,
|
|
|
|
| 52 |
"start_empty": false,
|
| 53 |
"iters": 3000,
|
| 54 |
"final_cost": 143.51204097823734,
|
| 55 |
+
"time": 14.196848392486572,
|
| 56 |
"fails": 0,
|
| 57 |
"side": "mm",
|
| 58 |
"cert": true,
|
|
|
|
| 69 |
"2": {
|
| 70 |
"pp": {
|
| 71 |
"start_empty": false,
|
| 72 |
+
"iters": 240,
|
| 73 |
+
"final_cost": 12.33047318175204,
|
| 74 |
+
"time": 1.760854959487915,
|
| 75 |
"fails": 0,
|
| 76 |
"side": "pp",
|
| 77 |
"cert": true,
|
| 78 |
+
"min_block_inflated": 4.036575518284735e-10,
|
| 79 |
"x": [
|
| 80 |
+
1.4991114407873156,
|
| 81 |
+
0.7888885595640853,
|
| 82 |
+
3.0228657804173715,
|
| 83 |
+
1.4617526811052668,
|
| 84 |
+
4.710363947148659,
|
| 85 |
+
1.3636731854596498,
|
| 86 |
+
8.198931056960044,
|
| 87 |
+
0.6327968449151149
|
| 88 |
]
|
| 89 |
},
|
| 90 |
"pm": {
|
| 91 |
"start_empty": false,
|
| 92 |
+
"iters": 314,
|
| 93 |
+
"final_cost": 256.24114694241644,
|
| 94 |
+
"time": 2.2794909477233887,
|
| 95 |
"fails": 0,
|
| 96 |
"side": "pm",
|
| 97 |
"cert": true,
|
| 98 |
+
"min_block_inflated": 7.916227673376852e-10,
|
| 99 |
"x": [
|
| 100 |
+
2.156007083761974,
|
| 101 |
+
1.595872159034455,
|
| 102 |
+
3.9301593524230194,
|
| 103 |
+
1.8839957516644426,
|
| 104 |
+
5.02903782430208,
|
| 105 |
+
-0.07348922168624439,
|
| 106 |
+
7.884209014440619,
|
| 107 |
+
-1.639392624832241
|
| 108 |
]
|
| 109 |
},
|
| 110 |
"mp": {
|
| 111 |
"start_empty": false,
|
| 112 |
+
"iters": 640,
|
| 113 |
+
"final_cost": 77.40887996462084,
|
| 114 |
+
"time": 4.71338677406311,
|
| 115 |
"fails": 0,
|
| 116 |
"side": "mp",
|
| 117 |
"cert": true,
|
| 118 |
+
"min_block_inflated": 6.000453467436273e-10,
|
| 119 |
"x": [
|
| 120 |
+
1.8121350589592868,
|
| 121 |
+
-0.9087959482449012,
|
| 122 |
+
3.5055128270529075,
|
| 123 |
+
-1.181798541471681,
|
| 124 |
+
4.960465572091284,
|
| 125 |
+
-0.06872292635467901,
|
| 126 |
+
8.142157679508028,
|
| 127 |
+
0.8608173763567915
|
| 128 |
]
|
| 129 |
},
|
| 130 |
"mm": {
|
| 131 |
"start_empty": false,
|
| 132 |
"iters": 3000,
|
| 133 |
"final_cost": 14.311050159679098,
|
| 134 |
+
"time": 20.964680433273315,
|
| 135 |
"fails": 0,
|
| 136 |
"side": "mm",
|
| 137 |
"cert": true,
|
|
|
|
| 147 |
-0.845732640193367
|
| 148 |
]
|
| 149 |
},
|
| 150 |
+
"E_star": 12.33047318175204
|
| 151 |
},
|
| 152 |
"3": {
|
| 153 |
"pp": {
|
| 154 |
"start_empty": false,
|
| 155 |
"iters": 22,
|
| 156 |
+
"final_cost": 3.5540533765938562,
|
| 157 |
+
"time": 0.2531704902648926,
|
| 158 |
"fails": 0,
|
| 159 |
"side": "pp",
|
| 160 |
"cert": true,
|
| 161 |
+
"min_block_inflated": 1.6729293731559958e-14,
|
| 162 |
"x": [
|
| 163 |
+
1.0133179640509602,
|
| 164 |
+
0.5140047880773698,
|
| 165 |
+
2.026635928101919,
|
| 166 |
+
1.0280095761547394,
|
| 167 |
+
3.0984302730564153,
|
| 168 |
+
1.234660110100514,
|
| 169 |
+
5.300867423410612,
|
| 170 |
+
1.3386512585433084,
|
| 171 |
+
6.46093765307991,
|
| 172 |
+
1.0813201252740599,
|
| 173 |
+
8.810503941374602,
|
| 174 |
+
0.41199449600240556
|
| 175 |
]
|
| 176 |
},
|
| 177 |
"pm": {
|
| 178 |
"start_empty": false,
|
| 179 |
"iters": 20,
|
| 180 |
"final_cost": 58.478341676860964,
|
| 181 |
+
"time": 0.21417713165283203,
|
| 182 |
"fails": 0,
|
| 183 |
"side": "pm",
|
| 184 |
"cert": true,
|
|
|
|
| 201 |
"mp": {
|
| 202 |
"start_empty": false,
|
| 203 |
"iters": 44,
|
| 204 |
+
"final_cost": 17.886976787475078,
|
| 205 |
+
"time": 0.5148844718933105,
|
| 206 |
"fails": 0,
|
| 207 |
"side": "mp",
|
| 208 |
"cert": true,
|
| 209 |
+
"min_block_inflated": -3.3288927170360694e-12,
|
| 210 |
"x": [
|
| 211 |
+
1.2009212837426118,
|
| 212 |
+
-0.47489096811307985,
|
| 213 |
+
2.4018425674852226,
|
| 214 |
+
-0.9497819362261599,
|
| 215 |
+
3.457459057667045,
|
| 216 |
+
-0.743705861238142,
|
| 217 |
+
5.414882422766158,
|
| 218 |
+
0.3877275214580106,
|
| 219 |
+
6.4798915504852985,
|
| 220 |
+
0.6306104042809856,
|
| 221 |
+
8.772450339102217,
|
| 222 |
+
0.4367466435519802
|
| 223 |
]
|
| 224 |
},
|
| 225 |
"mm": {
|
| 226 |
"start_empty": false,
|
| 227 |
"iters": 35,
|
| 228 |
+
"final_cost": 4.12839037995991,
|
| 229 |
+
"time": 0.4075932502746582,
|
| 230 |
"fails": 0,
|
| 231 |
"side": "mm",
|
| 232 |
"cert": true,
|
| 233 |
+
"min_block_inflated": -1.7763568394002505e-15,
|
| 234 |
"x": [
|
| 235 |
+
1.2010128855446238,
|
| 236 |
+
-0.4437787355929839,
|
| 237 |
+
2.4020257710892463,
|
| 238 |
+
-0.8875574711859675,
|
| 239 |
+
3.569229687421897,
|
| 240 |
+
-1.1644462682529086,
|
| 241 |
+
5.869815952833572,
|
| 242 |
+
-1.5512717366232585,
|
| 243 |
+
6.935605703185712,
|
| 244 |
+
-1.3275536142646753,
|
| 245 |
+
9.000697726768925,
|
| 246 |
+
-0.5519177459530461
|
| 247 |
]
|
| 248 |
},
|
| 249 |
+
"E_star": 3.5540533765938562
|
| 250 |
},
|
| 251 |
"4": {
|
| 252 |
"pp": {
|
| 253 |
"start_empty": false,
|
| 254 |
+
"iters": 2367,
|
| 255 |
+
"final_cost": 1.5046976757405446,
|
| 256 |
+
"time": 30.52169942855835,
|
| 257 |
"fails": 0,
|
| 258 |
"side": "pp",
|
| 259 |
"cert": true,
|
| 260 |
+
"min_block_inflated": 6.729590218412795e-10,
|
| 261 |
"x": [
|
| 262 |
+
0.7609409019080724,
|
| 263 |
+
0.38712238032971713,
|
| 264 |
+
1.5218818038203543,
|
| 265 |
+
0.7742447606588023,
|
| 266 |
+
2.30717680914203,
|
| 267 |
+
1.031132276900765,
|
| 268 |
+
3.907542811319584,
|
| 269 |
+
1.3856786099345288,
|
| 270 |
+
4.7498921931385905,
|
| 271 |
+
1.337464810970581,
|
| 272 |
+
6.459092396289522,
|
| 273 |
+
1.1100144609408282,
|
| 274 |
+
7.33819393735274,
|
| 275 |
+
0.8652665337606729,
|
| 276 |
+
9.10864773920864,
|
| 277 |
+
0.31025930329063256
|
| 278 |
]
|
| 279 |
},
|
| 280 |
"pm": {
|
| 281 |
"start_empty": false,
|
| 282 |
"iters": 30,
|
| 283 |
"final_cost": 25.135662384660918,
|
| 284 |
+
"time": 0.40508556365966797,
|
| 285 |
"fails": 0,
|
| 286 |
"side": "pm",
|
| 287 |
"cert": true,
|
|
|
|
| 307 |
},
|
| 308 |
"mp": {
|
| 309 |
"start_empty": false,
|
| 310 |
+
"iters": 172,
|
| 311 |
+
"final_cost": 7.782047670361862,
|
| 312 |
+
"time": 2.2780203819274902,
|
| 313 |
"fails": 0,
|
| 314 |
"side": "mp",
|
| 315 |
"cert": true,
|
| 316 |
+
"min_block_inflated": 8.855486344216956e-10,
|
| 317 |
"x": [
|
| 318 |
+
0.9108272377182836,
|
| 319 |
+
-0.36438915459293986,
|
| 320 |
+
1.8216544754500248,
|
| 321 |
+
-0.7287783091843789,
|
| 322 |
+
2.6621485600338106,
|
| 323 |
+
-0.8001941998191647,
|
| 324 |
+
4.239585079472477,
|
| 325 |
+
-0.5170834805744426,
|
| 326 |
+
4.960278447872856,
|
| 327 |
+
-0.07463605735591648,
|
| 328 |
+
6.4221005881593465,
|
| 329 |
+
0.7539139092975358,
|
| 330 |
+
7.277033596271645,
|
| 331 |
+
0.7123249797043246,
|
| 332 |
+
9.06598330219861,
|
| 333 |
+
0.33536802505645313
|
| 334 |
]
|
| 335 |
},
|
| 336 |
"mm": {
|
| 337 |
"start_empty": false,
|
| 338 |
+
"iters": 763,
|
| 339 |
+
"final_cost": 1.7480567594534477,
|
| 340 |
+
"time": 9.720959424972534,
|
| 341 |
"fails": 0,
|
| 342 |
"side": "mm",
|
| 343 |
"cert": true,
|
| 344 |
+
"min_block_inflated": 4.856328672531163e-10,
|
| 345 |
"x": [
|
| 346 |
+
0.8999502811519626,
|
| 347 |
+
-0.334237673659132,
|
| 348 |
+
1.7999005623037778,
|
| 349 |
+
-0.6684753473179719,
|
| 350 |
+
2.685760126716112,
|
| 351 |
+
-0.9320155702231205,
|
| 352 |
+
4.443388538800656,
|
| 353 |
+
-1.3883985652776503,
|
| 354 |
+
5.286975952976285,
|
| 355 |
+
-1.4398464359788363,
|
| 356 |
+
6.942668971668416,
|
| 357 |
+
-1.3847882757172765,
|
| 358 |
+
7.720863978110849,
|
| 359 |
+
-1.1081423663954657,
|
| 360 |
+
9.249529492278157,
|
| 361 |
+
-0.4157482285370345
|
| 362 |
]
|
| 363 |
},
|
| 364 |
+
"E_star": 1.5046976757405446
|
| 365 |
}
|
| 366 |
}
|
globmp/gridstart/reference/summary.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
{
|
| 2 |
"E_star": {
|
| 3 |
"1": 123.4334411701152,
|
| 4 |
-
"2": 12.
|
| 5 |
-
"3": 3.
|
| 6 |
-
"4": 1.
|
| 7 |
},
|
| 8 |
"totals": {
|
| 9 |
"grid_comparisons": 27,
|
|
@@ -23,9 +23,9 @@
|
|
| 23 |
"grid_points_sublevel_est": 77.35157451003172,
|
| 24 |
"tests_budget": 102,
|
| 25 |
"tests_togo": 102,
|
| 26 |
-
"time_budget": 0.
|
| 27 |
-
"time_togo": 0.
|
| 28 |
-
"time_grid": 0.
|
| 29 |
"same_as_grid": true,
|
| 30 |
"same_rules": true,
|
| 31 |
"fail": false,
|
|
@@ -48,9 +48,9 @@
|
|
| 48 |
"grid_points_sublevel_est": 244.46917376010012,
|
| 49 |
"tests_budget": 245,
|
| 50 |
"tests_togo": 245,
|
| 51 |
-
"time_budget": 0.
|
| 52 |
-
"time_togo": 0.
|
| 53 |
-
"time_grid": 0.
|
| 54 |
"same_as_grid": true,
|
| 55 |
"same_rules": true,
|
| 56 |
"fail": false,
|
|
@@ -73,9 +73,9 @@
|
|
| 73 |
"grid_points_sublevel_est": 506.9312787089437,
|
| 74 |
"tests_budget": 498,
|
| 75 |
"tests_togo": 498,
|
| 76 |
-
"time_budget": 0.
|
| 77 |
-
"time_togo": 0.
|
| 78 |
-
"time_grid": 0.
|
| 79 |
"same_as_grid": true,
|
| 80 |
"same_rules": true,
|
| 81 |
"fail": false,
|
|
@@ -98,9 +98,9 @@
|
|
| 98 |
"grid_points_sublevel_est": 1237.625192160507,
|
| 99 |
"tests_budget": 1308,
|
| 100 |
"tests_togo": 1308,
|
| 101 |
-
"time_budget": 0.
|
| 102 |
-
"time_togo": 0.
|
| 103 |
-
"time_grid": 0.
|
| 104 |
"same_as_grid": true,
|
| 105 |
"same_rules": true,
|
| 106 |
"fail": false,
|
|
@@ -123,9 +123,9 @@
|
|
| 123 |
"grid_points_sublevel_est": 3911.5067801616033,
|
| 124 |
"tests_budget": 3942,
|
| 125 |
"tests_togo": 3942,
|
| 126 |
-
"time_budget": 0.
|
| 127 |
-
"time_togo": 0.
|
| 128 |
-
"time_grid": 0.
|
| 129 |
"same_as_grid": true,
|
| 130 |
"same_rules": true,
|
| 131 |
"fail": false,
|
|
@@ -148,9 +148,9 @@
|
|
| 148 |
"grid_points_sublevel_est": 19802.0030745681,
|
| 149 |
"tests_budget": 19818,
|
| 150 |
"tests_togo": 19818,
|
| 151 |
-
"time_budget": 0.
|
| 152 |
-
"time_togo": 0.
|
| 153 |
-
"time_grid": 0.
|
| 154 |
"same_as_grid": true,
|
| 155 |
"same_rules": true,
|
| 156 |
"fail": false,
|
|
@@ -173,9 +173,9 @@
|
|
| 173 |
"grid_points_sublevel_est": 62584.108482585674,
|
| 174 |
"tests_budget": 62559,
|
| 175 |
"tests_togo": 62559,
|
| 176 |
-
"time_budget": 0.
|
| 177 |
-
"time_togo": 0.
|
| 178 |
-
"time_grid": 0.
|
| 179 |
"same_as_grid": true,
|
| 180 |
"same_rules": true,
|
| 181 |
"fail": false,
|
|
@@ -198,9 +198,9 @@
|
|
| 198 |
"grid_points_sublevel_est": 316832.0491930897,
|
| 199 |
"tests_budget": 318387,
|
| 200 |
"tests_togo": 318387,
|
| 201 |
-
"time_budget": 0.
|
| 202 |
-
"time_togo": 0.
|
| 203 |
-
"time_grid": 0.
|
| 204 |
"same_as_grid": true,
|
| 205 |
"same_rules": true,
|
| 206 |
"fail": false,
|
|
@@ -223,9 +223,9 @@
|
|
| 223 |
"grid_points_sublevel_est": 1001345.7357213711,
|
| 224 |
"tests_budget": 1000995,
|
| 225 |
"tests_togo": 1000995,
|
| 226 |
-
"time_budget": 1.
|
| 227 |
-
"time_togo": 1.
|
| 228 |
-
"time_grid": 0.
|
| 229 |
"same_as_grid": true,
|
| 230 |
"same_rules": true,
|
| 231 |
"fail": false,
|
|
@@ -248,9 +248,9 @@
|
|
| 248 |
"grid_points_sublevel_est": 5069312.787089428,
|
| 249 |
"tests_budget": 5072808,
|
| 250 |
"tests_togo": 5072808,
|
| 251 |
-
"time_budget": 9.
|
| 252 |
-
"time_togo": 9.
|
| 253 |
-
"time_grid": 2.
|
| 254 |
"same_as_grid": true,
|
| 255 |
"same_rules": true,
|
| 256 |
"fail": false,
|
|
@@ -270,16 +270,16 @@
|
|
| 270 |
"free_coords": 8,
|
| 271 |
"grid_points_box": 216.0,
|
| 272 |
"grid_points_sublevel": 4,
|
| 273 |
-
"grid_points_sublevel_est": 0.
|
| 274 |
"tests_budget": null,
|
| 275 |
"tests_togo": null,
|
| 276 |
-
"time_budget": 0.
|
| 277 |
-
"time_togo": 0.
|
| 278 |
-
"time_grid": 0.
|
| 279 |
"same_as_grid": true,
|
| 280 |
"same_rules": true,
|
| 281 |
"fail": true,
|
| 282 |
-
"E_star": 12.
|
| 283 |
},
|
| 284 |
{
|
| 285 |
"N": 2,
|
|
@@ -287,16 +287,16 @@
|
|
| 287 |
"free_coords": 8,
|
| 288 |
"grid_points_box": 12960.0,
|
| 289 |
"grid_points_sublevel": 7,
|
| 290 |
-
"grid_points_sublevel_est": 2.
|
| 291 |
"tests_budget": null,
|
| 292 |
"tests_togo": null,
|
| 293 |
-
"time_budget": 0.
|
| 294 |
-
"time_togo": 0.
|
| 295 |
-
"time_grid": 0.
|
| 296 |
"same_as_grid": true,
|
| 297 |
"same_rules": true,
|
| 298 |
"fail": true,
|
| 299 |
-
"E_star": 12.
|
| 300 |
},
|
| 301 |
{
|
| 302 |
"N": 2,
|
|
@@ -304,16 +304,16 @@
|
|
| 304 |
"free_coords": 8,
|
| 305 |
"grid_points_box": 50625.0,
|
| 306 |
"grid_points_sublevel": 7,
|
| 307 |
-
"grid_points_sublevel_est": 9.
|
| 308 |
"tests_budget": null,
|
| 309 |
"tests_togo": null,
|
| 310 |
-
"time_budget": 0.
|
| 311 |
-
"time_togo": 0.
|
| 312 |
-
"time_grid": 0.
|
| 313 |
"same_as_grid": true,
|
| 314 |
"same_rules": true,
|
| 315 |
"fail": true,
|
| 316 |
-
"E_star": 12.
|
| 317 |
},
|
| 318 |
{
|
| 319 |
"N": 2,
|
|
@@ -321,21 +321,21 @@
|
|
| 321 |
"free_coords": 8,
|
| 322 |
"grid_points_box": 151200.0,
|
| 323 |
"grid_points_sublevel": 111,
|
| 324 |
-
"grid_points_sublevel_est": 57.
|
| 325 |
"tests_budget": 412,
|
| 326 |
"tests_togo": 71,
|
| 327 |
-
"time_budget": 0.
|
| 328 |
-
"time_togo": 0.
|
| 329 |
-
"time_grid": 0.
|
| 330 |
"same_as_grid": true,
|
| 331 |
"same_rules": true,
|
| 332 |
"fail": false,
|
| 333 |
-
"E_star": 12.
|
| 334 |
"zh_cost": 36.0,
|
| 335 |
-
"f_ratio": 2.
|
| 336 |
"zh_side": "mm",
|
| 337 |
"zh_cert": true,
|
| 338 |
-
"exact_gap": 0.
|
| 339 |
"exact_side": "mm",
|
| 340 |
"exact_cert": true,
|
| 341 |
"exact_ok": false
|
|
@@ -346,21 +346,21 @@
|
|
| 346 |
"free_coords": 8,
|
| 347 |
"grid_points_box": 2520000.0,
|
| 348 |
"grid_points_sublevel": 565,
|
| 349 |
-
"grid_points_sublevel_est": 571.
|
| 350 |
"tests_budget": 2327,
|
| 351 |
"tests_togo": 316,
|
| 352 |
-
"time_budget": 0.
|
| 353 |
-
"time_togo": 0.
|
| 354 |
-
"time_grid": 0.
|
| 355 |
"same_as_grid": true,
|
| 356 |
"same_rules": true,
|
| 357 |
"fail": false,
|
| 358 |
-
"E_star": 12.
|
| 359 |
"zh_cost": 18.75,
|
| 360 |
-
"f_ratio": 1.
|
| 361 |
"zh_side": "pp",
|
| 362 |
"zh_cert": true,
|
| 363 |
-
"exact_gap":
|
| 364 |
"exact_side": "pp",
|
| 365 |
"exact_cert": true,
|
| 366 |
"exact_ok": true
|
|
@@ -371,21 +371,21 @@
|
|
| 371 |
"free_coords": 8,
|
| 372 |
"grid_points_box": 59195136.0,
|
| 373 |
"grid_points_sublevel": 16426,
|
| 374 |
-
"grid_points_sublevel_est": 14643.
|
| 375 |
"tests_budget": 26013,
|
| 376 |
"tests_togo": 4307,
|
| 377 |
-
"time_budget": 0.
|
| 378 |
-
"time_togo": 0.
|
| 379 |
-
"time_grid": 0.
|
| 380 |
"same_as_grid": true,
|
| 381 |
"same_rules": true,
|
| 382 |
"fail": false,
|
| 383 |
-
"E_star": 12.
|
| 384 |
"zh_cost": 21.0,
|
| 385 |
-
"f_ratio": 1.
|
| 386 |
"zh_side": "pp",
|
| 387 |
"zh_cert": true,
|
| 388 |
-
"exact_gap":
|
| 389 |
"exact_side": "pp",
|
| 390 |
"exact_cert": true,
|
| 391 |
"exact_ok": true
|
|
@@ -396,21 +396,21 @@
|
|
| 396 |
"free_coords": 8,
|
| 397 |
"grid_points_box": 740520000.0,
|
| 398 |
"grid_points_sublevel": 148257,
|
| 399 |
-
"grid_points_sublevel_est": 146267.
|
| 400 |
"tests_budget": 149597,
|
| 401 |
"tests_togo": 24505,
|
| 402 |
-
"time_budget": 0.
|
| 403 |
-
"time_togo": 0.
|
| 404 |
-
"time_grid":
|
| 405 |
"same_as_grid": true,
|
| 406 |
"same_rules": true,
|
| 407 |
"fail": false,
|
| 408 |
-
"E_star": 12.
|
| 409 |
"zh_cost": 16.5,
|
| 410 |
-
"f_ratio": 1.
|
| 411 |
"zh_side": "pp",
|
| 412 |
"zh_cert": true,
|
| 413 |
-
"exact_gap":
|
| 414 |
"exact_side": "pp",
|
| 415 |
"exact_cert": true,
|
| 416 |
"exact_ok": true
|
|
@@ -421,21 +421,21 @@
|
|
| 421 |
"free_coords": 8,
|
| 422 |
"grid_points_box": 16068375000.0,
|
| 423 |
"grid_points_sublevel": 3613342,
|
| 424 |
-
"grid_points_sublevel_est": 3748669.
|
| 425 |
"tests_budget": 1717038,
|
| 426 |
"tests_togo": 254288,
|
| 427 |
-
"time_budget":
|
| 428 |
-
"time_togo":
|
| 429 |
-
"time_grid":
|
| 430 |
"same_as_grid": true,
|
| 431 |
"same_rules": true,
|
| 432 |
"fail": false,
|
| 433 |
-
"E_star": 12.
|
| 434 |
"zh_cost": 14.25,
|
| 435 |
-
"f_ratio": 1.
|
| 436 |
"zh_side": "pp",
|
| 437 |
"zh_cert": true,
|
| 438 |
-
"exact_gap":
|
| 439 |
"exact_side": "pp",
|
| 440 |
"exact_cert": true,
|
| 441 |
"exact_ok": true
|
|
@@ -446,21 +446,21 @@
|
|
| 446 |
"free_coords": 8,
|
| 447 |
"grid_points_box": 181900857600.0,
|
| 448 |
"grid_points_sublevel": null,
|
| 449 |
-
"grid_points_sublevel_est": 37444410.
|
| 450 |
"tests_budget": 9649277,
|
| 451 |
"tests_togo": 1329112,
|
| 452 |
-
"time_budget":
|
| 453 |
-
"time_togo": 4.
|
| 454 |
"time_grid": null,
|
| 455 |
"same_as_grid": null,
|
| 456 |
"same_rules": true,
|
| 457 |
"fail": false,
|
| 458 |
-
"E_star": 12.
|
| 459 |
"zh_cost": 13.96875,
|
| 460 |
-
"f_ratio": 1.
|
| 461 |
"zh_side": "pp",
|
| 462 |
"zh_cert": true,
|
| 463 |
-
"exact_gap": 6.
|
| 464 |
"exact_side": "pp",
|
| 465 |
"exact_cert": true,
|
| 466 |
"exact_ok": true
|
|
@@ -471,21 +471,21 @@
|
|
| 471 |
"free_coords": 8,
|
| 472 |
"grid_points_box": 4119345720000.0,
|
| 473 |
"grid_points_sublevel": null,
|
| 474 |
-
"grid_points_sublevel_est":
|
| 475 |
"tests_budget": 106403214,
|
| 476 |
"tests_togo": 12669999,
|
| 477 |
-
"time_budget":
|
| 478 |
-
"time_togo": 40.
|
| 479 |
"time_grid": null,
|
| 480 |
"same_as_grid": null,
|
| 481 |
"same_rules": true,
|
| 482 |
"fail": false,
|
| 483 |
-
"E_star": 12.
|
| 484 |
"zh_cost": 12.9375,
|
| 485 |
-
"f_ratio": 1.
|
| 486 |
"zh_side": "pp",
|
| 487 |
"zh_cert": true,
|
| 488 |
-
"exact_gap": 5.
|
| 489 |
"exact_side": "pp",
|
| 490 |
"exact_cert": true,
|
| 491 |
"exact_ok": true
|
|
@@ -496,16 +496,16 @@
|
|
| 496 |
"free_coords": 12,
|
| 497 |
"grid_points_box": 7776.0,
|
| 498 |
"grid_points_sublevel": 0,
|
| 499 |
-
"grid_points_sublevel_est": 2.
|
| 500 |
"tests_budget": null,
|
| 501 |
"tests_togo": null,
|
| 502 |
-
"time_budget": 0.
|
| 503 |
-
"time_togo": 0.
|
| 504 |
-
"time_grid": 0.
|
| 505 |
"same_as_grid": true,
|
| 506 |
"same_rules": true,
|
| 507 |
"fail": true,
|
| 508 |
-
"E_star": 3.
|
| 509 |
},
|
| 510 |
{
|
| 511 |
"N": 3,
|
|
@@ -513,16 +513,16 @@
|
|
| 513 |
"free_coords": 12,
|
| 514 |
"grid_points_box": 15552.0,
|
| 515 |
"grid_points_sublevel": 0,
|
| 516 |
-
"grid_points_sublevel_est": 0.
|
| 517 |
"tests_budget": null,
|
| 518 |
"tests_togo": null,
|
| 519 |
-
"time_budget": 0.
|
| 520 |
-
"time_togo": 0.
|
| 521 |
-
"time_grid": 0.
|
| 522 |
"same_as_grid": true,
|
| 523 |
"same_rules": true,
|
| 524 |
"fail": true,
|
| 525 |
-
"E_star": 3.
|
| 526 |
},
|
| 527 |
{
|
| 528 |
"N": 3,
|
|
@@ -530,16 +530,16 @@
|
|
| 530 |
"free_coords": 12,
|
| 531 |
"grid_points_box": 2592000.0,
|
| 532 |
"grid_points_sublevel": 0,
|
| 533 |
-
"grid_points_sublevel_est": 0.
|
| 534 |
"tests_budget": null,
|
| 535 |
"tests_togo": null,
|
| 536 |
-
"time_budget": 0.
|
| 537 |
-
"time_togo": 0.
|
| 538 |
-
"time_grid": 0.
|
| 539 |
"same_as_grid": true,
|
| 540 |
"same_rules": true,
|
| 541 |
"fail": true,
|
| 542 |
-
"E_star": 3.
|
| 543 |
},
|
| 544 |
{
|
| 545 |
"N": 3,
|
|
@@ -547,16 +547,16 @@
|
|
| 547 |
"free_coords": 12,
|
| 548 |
"grid_points_box": 30375000.0,
|
| 549 |
"grid_points_sublevel": 5,
|
| 550 |
-
"grid_points_sublevel_est": 0.
|
| 551 |
"tests_budget": null,
|
| 552 |
"tests_togo": null,
|
| 553 |
-
"time_budget": 0.
|
| 554 |
-
"time_togo": 0.
|
| 555 |
-
"time_grid": 0.
|
| 556 |
"same_as_grid": true,
|
| 557 |
"same_rules": true,
|
| 558 |
"fail": true,
|
| 559 |
-
"E_star": 3.
|
| 560 |
},
|
| 561 |
{
|
| 562 |
"N": 3,
|
|
@@ -564,16 +564,16 @@
|
|
| 564 |
"free_coords": 12,
|
| 565 |
"grid_points_box": 311169600.0,
|
| 566 |
"grid_points_sublevel": 4,
|
| 567 |
-
"grid_points_sublevel_est": 3.
|
| 568 |
"tests_budget": null,
|
| 569 |
"tests_togo": null,
|
| 570 |
-
"time_budget": 0.
|
| 571 |
-
"time_togo": 0.
|
| 572 |
-
"time_grid": 2.
|
| 573 |
"same_as_grid": true,
|
| 574 |
"same_rules": true,
|
| 575 |
"fail": true,
|
| 576 |
-
"E_star": 3.
|
| 577 |
},
|
| 578 |
{
|
| 579 |
"N": 3,
|
|
@@ -581,21 +581,21 @@
|
|
| 581 |
"free_coords": 12,
|
| 582 |
"grid_points_box": 71874000000.0,
|
| 583 |
"grid_points_sublevel": null,
|
| 584 |
-
"grid_points_sublevel_est": 442.
|
| 585 |
"tests_budget": 3551,
|
| 586 |
"tests_togo": 367,
|
| 587 |
-
"time_budget": 0.
|
| 588 |
-
"time_togo": 0.
|
| 589 |
"time_grid": null,
|
| 590 |
"same_as_grid": null,
|
| 591 |
"same_rules": true,
|
| 592 |
"fail": false,
|
| 593 |
-
"E_star": 3.
|
| 594 |
"zh_cost": 12.0,
|
| 595 |
-
"f_ratio": 3.
|
| 596 |
"zh_side": "pp",
|
| 597 |
"zh_cert": true,
|
| 598 |
-
"exact_gap":
|
| 599 |
"exact_side": "pp",
|
| 600 |
"exact_cert": true,
|
| 601 |
"exact_ok": true
|
|
@@ -606,21 +606,21 @@
|
|
| 606 |
"free_coords": 12,
|
| 607 |
"grid_points_box": 1991416867440.0,
|
| 608 |
"grid_points_sublevel": null,
|
| 609 |
-
"grid_points_sublevel_est": 13968.
|
| 610 |
"tests_budget": 31562,
|
| 611 |
"tests_togo": 2988,
|
| 612 |
-
"time_budget": 0.
|
| 613 |
-
"time_togo": 0.
|
| 614 |
"time_grid": null,
|
| 615 |
"same_as_grid": null,
|
| 616 |
"same_rules": true,
|
| 617 |
"fail": false,
|
| 618 |
-
"E_star": 3.
|
| 619 |
"zh_cost": 8.0625,
|
| 620 |
-
"f_ratio": 2.
|
| 621 |
"zh_side": "pp",
|
| 622 |
"zh_cert": true,
|
| 623 |
-
"exact_gap":
|
| 624 |
"exact_side": "pp",
|
| 625 |
"exact_cert": true,
|
| 626 |
"exact_ok": true
|
|
@@ -631,21 +631,21 @@
|
|
| 631 |
"free_coords": 12,
|
| 632 |
"grid_points_box": 340502944320000.0,
|
| 633 |
"grid_points_sublevel": null,
|
| 634 |
-
"grid_points_sublevel_est": 1812316.
|
| 635 |
"tests_budget": 865149,
|
| 636 |
"tests_togo": 45446,
|
| 637 |
-
"time_budget": 10.
|
| 638 |
-
"time_togo": 2.
|
| 639 |
"time_grid": null,
|
| 640 |
"same_as_grid": null,
|
| 641 |
"same_rules": true,
|
| 642 |
"fail": false,
|
| 643 |
-
"E_star": 3.
|
| 644 |
"zh_cost": 4.5,
|
| 645 |
-
"f_ratio": 1.
|
| 646 |
"zh_side": "pp",
|
| 647 |
"zh_cert": true,
|
| 648 |
-
"exact_gap":
|
| 649 |
"exact_side": "pp",
|
| 650 |
"exact_cert": true,
|
| 651 |
"exact_ok": true
|
|
@@ -656,16 +656,16 @@
|
|
| 656 |
"free_coords": 16,
|
| 657 |
"grid_points_box": 23328.0,
|
| 658 |
"grid_points_sublevel": 0,
|
| 659 |
-
"grid_points_sublevel_est": 3.
|
| 660 |
"tests_budget": null,
|
| 661 |
"tests_togo": null,
|
| 662 |
-
"time_budget": 0.
|
| 663 |
-
"time_togo": 0.
|
| 664 |
-
"time_grid": 0.
|
| 665 |
"same_as_grid": true,
|
| 666 |
"same_rules": true,
|
| 667 |
"fail": true,
|
| 668 |
-
"E_star": 1.
|
| 669 |
},
|
| 670 |
{
|
| 671 |
"N": 4,
|
|
@@ -673,16 +673,16 @@
|
|
| 673 |
"free_coords": 16,
|
| 674 |
"grid_points_box": 2519424.0,
|
| 675 |
"grid_points_sublevel": 0,
|
| 676 |
-
"grid_points_sublevel_est": 3.
|
| 677 |
"tests_budget": null,
|
| 678 |
"tests_togo": null,
|
| 679 |
-
"time_budget": 0.
|
| 680 |
-
"time_togo": 0.
|
| 681 |
-
"time_grid": 0.
|
| 682 |
"same_as_grid": true,
|
| 683 |
"same_rules": true,
|
| 684 |
"fail": true,
|
| 685 |
-
"E_star": 1.
|
| 686 |
},
|
| 687 |
{
|
| 688 |
"N": 4,
|
|
@@ -690,16 +690,16 @@
|
|
| 690 |
"free_coords": 16,
|
| 691 |
"grid_points_box": 29160000.0,
|
| 692 |
"grid_points_sublevel": 0,
|
| 693 |
-
"grid_points_sublevel_est": 5.
|
| 694 |
"tests_budget": null,
|
| 695 |
"tests_togo": null,
|
| 696 |
-
"time_budget": 0.
|
| 697 |
-
"time_togo": 0.
|
| 698 |
-
"time_grid":
|
| 699 |
"same_as_grid": true,
|
| 700 |
"same_rules": true,
|
| 701 |
"fail": true,
|
| 702 |
-
"E_star": 1.
|
| 703 |
},
|
| 704 |
{
|
| 705 |
"N": 4,
|
|
@@ -707,16 +707,16 @@
|
|
| 707 |
"free_coords": 16,
|
| 708 |
"grid_points_box": 360000000.0,
|
| 709 |
"grid_points_sublevel": 0,
|
| 710 |
-
"grid_points_sublevel_est": 2.
|
| 711 |
"tests_budget": null,
|
| 712 |
"tests_togo": null,
|
| 713 |
"time_budget": 0.00027441978454589844,
|
| 714 |
-
"time_togo": 0.
|
| 715 |
-
"time_grid":
|
| 716 |
"same_as_grid": true,
|
| 717 |
"same_rules": true,
|
| 718 |
"fail": true,
|
| 719 |
-
"E_star": 1.
|
| 720 |
},
|
| 721 |
{
|
| 722 |
"N": 4,
|
|
@@ -724,16 +724,16 @@
|
|
| 724 |
"free_coords": 16,
|
| 725 |
"grid_points_box": 233377200000.0,
|
| 726 |
"grid_points_sublevel": null,
|
| 727 |
-
"grid_points_sublevel_est": 0.
|
| 728 |
"tests_budget": null,
|
| 729 |
"tests_togo": null,
|
| 730 |
-
"time_budget": 0.
|
| 731 |
-
"time_togo": 0.
|
| 732 |
"time_grid": null,
|
| 733 |
"same_as_grid": null,
|
| 734 |
"same_rules": true,
|
| 735 |
"fail": true,
|
| 736 |
-
"E_star": 1.
|
| 737 |
},
|
| 738 |
{
|
| 739 |
"N": 4,
|
|
@@ -741,16 +741,16 @@
|
|
| 741 |
"free_coords": 16,
|
| 742 |
"grid_points_box": 81335585358720.0,
|
| 743 |
"grid_points_sublevel": null,
|
| 744 |
-
"grid_points_sublevel_est": 1.
|
| 745 |
"tests_budget": null,
|
| 746 |
"tests_togo": null,
|
| 747 |
-
"time_budget": 0.
|
| 748 |
-
"time_togo": 0.
|
| 749 |
"time_grid": null,
|
| 750 |
"same_as_grid": null,
|
| 751 |
"same_rules": true,
|
| 752 |
"fail": true,
|
| 753 |
-
"E_star": 1.
|
| 754 |
},
|
| 755 |
{
|
| 756 |
"N": 4,
|
|
@@ -758,21 +758,21 @@
|
|
| 758 |
"free_coords": 16,
|
| 759 |
"grid_points_box": 7879889144531250.0,
|
| 760 |
"grid_points_sublevel": null,
|
| 761 |
-
"grid_points_sublevel_est": 135.
|
| 762 |
"tests_budget": 4279,
|
| 763 |
"tests_togo": 462,
|
| 764 |
-
"time_budget": 0.
|
| 765 |
-
"time_togo": 0.
|
| 766 |
"time_grid": null,
|
| 767 |
"same_as_grid": null,
|
| 768 |
"same_rules": true,
|
| 769 |
"fail": false,
|
| 770 |
-
"E_star": 1.
|
| 771 |
"zh_cost": 5.8125,
|
| 772 |
-
"f_ratio": 3.
|
| 773 |
"zh_side": "mm",
|
| 774 |
"zh_cert": true,
|
| 775 |
-
"exact_gap": 0.
|
| 776 |
"exact_side": "mm",
|
| 777 |
"exact_cert": true,
|
| 778 |
"exact_ok": false
|
|
@@ -783,21 +783,21 @@
|
|
| 783 |
"free_coords": 16,
|
| 784 |
"grid_points_box": 5.882921604607162e+18,
|
| 785 |
"grid_points_sublevel": null,
|
| 786 |
-
"grid_points_sublevel_est": 88849.
|
| 787 |
"tests_budget": 208929,
|
| 788 |
"tests_togo": 10144,
|
| 789 |
-
"time_budget":
|
| 790 |
-
"time_togo": 1.
|
| 791 |
"time_grid": null,
|
| 792 |
"same_as_grid": null,
|
| 793 |
"same_rules": true,
|
| 794 |
"fail": false,
|
| 795 |
-
"E_star": 1.
|
| 796 |
"zh_cost": 3.75,
|
| 797 |
-
"f_ratio": 2.
|
| 798 |
"zh_side": "pp",
|
| 799 |
"zh_cert": true,
|
| 800 |
-
"exact_gap":
|
| 801 |
"exact_side": "pp",
|
| 802 |
"exact_cert": true,
|
| 803 |
"exact_ok": true
|
|
|
|
| 1 |
{
|
| 2 |
"E_star": {
|
| 3 |
"1": 123.4334411701152,
|
| 4 |
+
"2": 12.33047318175204,
|
| 5 |
+
"3": 3.5540533765938562,
|
| 6 |
+
"4": 1.5046976757405446
|
| 7 |
},
|
| 8 |
"totals": {
|
| 9 |
"grid_comparisons": 27,
|
|
|
|
| 23 |
"grid_points_sublevel_est": 77.35157451003172,
|
| 24 |
"tests_budget": 102,
|
| 25 |
"tests_togo": 102,
|
| 26 |
+
"time_budget": 0.0007977485656738281,
|
| 27 |
+
"time_togo": 0.001413583755493164,
|
| 28 |
+
"time_grid": 0.0008008480072021484,
|
| 29 |
"same_as_grid": true,
|
| 30 |
"same_rules": true,
|
| 31 |
"fail": false,
|
|
|
|
| 48 |
"grid_points_sublevel_est": 244.46917376010012,
|
| 49 |
"tests_budget": 245,
|
| 50 |
"tests_togo": 245,
|
| 51 |
+
"time_budget": 0.001039266586303711,
|
| 52 |
+
"time_togo": 0.0018033981323242188,
|
| 53 |
+
"time_grid": 0.0010919570922851562,
|
| 54 |
"same_as_grid": true,
|
| 55 |
"same_rules": true,
|
| 56 |
"fail": false,
|
|
|
|
| 73 |
"grid_points_sublevel_est": 506.9312787089437,
|
| 74 |
"tests_budget": 498,
|
| 75 |
"tests_togo": 498,
|
| 76 |
+
"time_budget": 0.0014238357543945312,
|
| 77 |
+
"time_togo": 0.0021495819091796875,
|
| 78 |
+
"time_grid": 0.0015783309936523438,
|
| 79 |
"same_as_grid": true,
|
| 80 |
"same_rules": true,
|
| 81 |
"fail": false,
|
|
|
|
| 98 |
"grid_points_sublevel_est": 1237.625192160507,
|
| 99 |
"tests_budget": 1308,
|
| 100 |
"tests_togo": 1308,
|
| 101 |
+
"time_budget": 0.0025246143341064453,
|
| 102 |
+
"time_togo": 0.003469228744506836,
|
| 103 |
+
"time_grid": 0.002949953079223633,
|
| 104 |
"same_as_grid": true,
|
| 105 |
"same_rules": true,
|
| 106 |
"fail": false,
|
|
|
|
| 123 |
"grid_points_sublevel_est": 3911.5067801616033,
|
| 124 |
"tests_budget": 3942,
|
| 125 |
"tests_togo": 3942,
|
| 126 |
+
"time_budget": 0.006529331207275391,
|
| 127 |
+
"time_togo": 0.007988929748535156,
|
| 128 |
+
"time_grid": 0.007999420166015625,
|
| 129 |
"same_as_grid": true,
|
| 130 |
"same_rules": true,
|
| 131 |
"fail": false,
|
|
|
|
| 148 |
"grid_points_sublevel_est": 19802.0030745681,
|
| 149 |
"tests_budget": 19818,
|
| 150 |
"tests_togo": 19818,
|
| 151 |
+
"time_budget": 0.034430742263793945,
|
| 152 |
+
"time_togo": 0.0386195182800293,
|
| 153 |
+
"time_grid": 0.04340958595275879,
|
| 154 |
"same_as_grid": true,
|
| 155 |
"same_rules": true,
|
| 156 |
"fail": false,
|
|
|
|
| 173 |
"grid_points_sublevel_est": 62584.108482585674,
|
| 174 |
"tests_budget": 62559,
|
| 175 |
"tests_togo": 62559,
|
| 176 |
+
"time_budget": 0.10349655151367188,
|
| 177 |
+
"time_togo": 0.12362122535705566,
|
| 178 |
+
"time_grid": 0.1361405849456787,
|
| 179 |
"same_as_grid": true,
|
| 180 |
"same_rules": true,
|
| 181 |
"fail": false,
|
|
|
|
| 198 |
"grid_points_sublevel_est": 316832.0491930897,
|
| 199 |
"tests_budget": 318387,
|
| 200 |
"tests_togo": 318387,
|
| 201 |
+
"time_budget": 0.5359923839569092,
|
| 202 |
+
"time_togo": 0.5767581462860107,
|
| 203 |
+
"time_grid": 0.43652844429016113,
|
| 204 |
"same_as_grid": true,
|
| 205 |
"same_rules": true,
|
| 206 |
"fail": false,
|
|
|
|
| 223 |
"grid_points_sublevel_est": 1001345.7357213711,
|
| 224 |
"tests_budget": 1000995,
|
| 225 |
"tests_togo": 1000995,
|
| 226 |
+
"time_budget": 1.750406265258789,
|
| 227 |
+
"time_togo": 1.7941796779632568,
|
| 228 |
+
"time_grid": 0.669334888458252,
|
| 229 |
"same_as_grid": true,
|
| 230 |
"same_rules": true,
|
| 231 |
"fail": false,
|
|
|
|
| 248 |
"grid_points_sublevel_est": 5069312.787089428,
|
| 249 |
"tests_budget": 5072808,
|
| 250 |
"tests_togo": 5072808,
|
| 251 |
+
"time_budget": 9.206470489501953,
|
| 252 |
+
"time_togo": 9.210951805114746,
|
| 253 |
+
"time_grid": 2.5156922340393066,
|
| 254 |
"same_as_grid": true,
|
| 255 |
"same_rules": true,
|
| 256 |
"fail": false,
|
|
|
|
| 270 |
"free_coords": 8,
|
| 271 |
"grid_points_box": 216.0,
|
| 272 |
"grid_points_sublevel": 4,
|
| 273 |
+
"grid_points_sublevel_est": 0.2234380894375186,
|
| 274 |
"tests_budget": null,
|
| 275 |
"tests_togo": null,
|
| 276 |
+
"time_budget": 0.0004966259002685547,
|
| 277 |
+
"time_togo": 0.0006866455078125,
|
| 278 |
+
"time_grid": 0.00043487548828125,
|
| 279 |
"same_as_grid": true,
|
| 280 |
"same_rules": true,
|
| 281 |
"fail": true,
|
| 282 |
+
"E_star": 12.33047318175204
|
| 283 |
},
|
| 284 |
{
|
| 285 |
"N": 2,
|
|
|
|
| 287 |
"free_coords": 8,
|
| 288 |
"grid_points_box": 12960.0,
|
| 289 |
"grid_points_sublevel": 7,
|
| 290 |
+
"grid_points_sublevel_est": 2.2318607878947136,
|
| 291 |
"tests_budget": null,
|
| 292 |
"tests_togo": null,
|
| 293 |
+
"time_budget": 0.0008394718170166016,
|
| 294 |
+
"time_togo": 0.0014548301696777344,
|
| 295 |
+
"time_grid": 0.0008957386016845703,
|
| 296 |
"same_as_grid": true,
|
| 297 |
"same_rules": true,
|
| 298 |
"fail": true,
|
| 299 |
+
"E_star": 12.33047318175204
|
| 300 |
},
|
| 301 |
{
|
| 302 |
"N": 2,
|
|
|
|
| 304 |
"free_coords": 8,
|
| 305 |
"grid_points_box": 50625.0,
|
| 306 |
"grid_points_sublevel": 7,
|
| 307 |
+
"grid_points_sublevel_est": 9.596592868148651,
|
| 308 |
"tests_budget": null,
|
| 309 |
"tests_togo": null,
|
| 310 |
+
"time_budget": 0.0010533332824707031,
|
| 311 |
+
"time_togo": 0.0012578964233398438,
|
| 312 |
+
"time_grid": 0.0011456012725830078,
|
| 313 |
"same_as_grid": true,
|
| 314 |
"same_rules": true,
|
| 315 |
"fail": true,
|
| 316 |
+
"E_star": 12.33047318175204
|
| 317 |
},
|
| 318 |
{
|
| 319 |
"N": 2,
|
|
|
|
| 321 |
"free_coords": 8,
|
| 322 |
"grid_points_box": 151200.0,
|
| 323 |
"grid_points_sublevel": 111,
|
| 324 |
+
"grid_points_sublevel_est": 57.20015089600475,
|
| 325 |
"tests_budget": 412,
|
| 326 |
"tests_togo": 71,
|
| 327 |
+
"time_budget": 0.0039033889770507812,
|
| 328 |
+
"time_togo": 0.004077911376953125,
|
| 329 |
+
"time_grid": 0.005534172058105469,
|
| 330 |
"same_as_grid": true,
|
| 331 |
"same_rules": true,
|
| 332 |
"fail": false,
|
| 333 |
+
"E_star": 12.33047318175204,
|
| 334 |
"zh_cost": 36.0,
|
| 335 |
+
"f_ratio": 2.919595985438472,
|
| 336 |
"zh_side": "mm",
|
| 337 |
"zh_cert": true,
|
| 338 |
+
"exact_gap": 0.16062457223494042,
|
| 339 |
"exact_side": "mm",
|
| 340 |
"exact_cert": true,
|
| 341 |
"exact_ok": false
|
|
|
|
| 346 |
"free_coords": 8,
|
| 347 |
"grid_points_box": 2520000.0,
|
| 348 |
"grid_points_sublevel": 565,
|
| 349 |
+
"grid_points_sublevel_est": 571.3563617010466,
|
| 350 |
"tests_budget": 2327,
|
| 351 |
"tests_togo": 316,
|
| 352 |
+
"time_budget": 0.006096839904785156,
|
| 353 |
+
"time_togo": 0.005394697189331055,
|
| 354 |
+
"time_grid": 0.016963481903076172,
|
| 355 |
"same_as_grid": true,
|
| 356 |
"same_rules": true,
|
| 357 |
"fail": false,
|
| 358 |
+
"E_star": 12.33047318175204,
|
| 359 |
"zh_cost": 18.75,
|
| 360 |
+
"f_ratio": 1.5206229090825374,
|
| 361 |
"zh_side": "pp",
|
| 362 |
"zh_cert": true,
|
| 363 |
+
"exact_gap": 1.7886803149735897e-11,
|
| 364 |
"exact_side": "pp",
|
| 365 |
"exact_cert": true,
|
| 366 |
"exact_ok": true
|
|
|
|
| 371 |
"free_coords": 8,
|
| 372 |
"grid_points_box": 59195136.0,
|
| 373 |
"grid_points_sublevel": 16426,
|
| 374 |
+
"grid_points_sublevel_est": 14643.2386293772,
|
| 375 |
"tests_budget": 26013,
|
| 376 |
"tests_togo": 4307,
|
| 377 |
+
"time_budget": 0.04921674728393555,
|
| 378 |
+
"time_togo": 0.04071164131164551,
|
| 379 |
+
"time_grid": 0.436643123626709,
|
| 380 |
"same_as_grid": true,
|
| 381 |
"same_rules": true,
|
| 382 |
"fail": false,
|
| 383 |
+
"E_star": 12.33047318175204,
|
| 384 |
"zh_cost": 21.0,
|
| 385 |
+
"f_ratio": 1.703097658172442,
|
| 386 |
"zh_side": "pp",
|
| 387 |
"zh_cert": true,
|
| 388 |
+
"exact_gap": 2.51705323250917e-11,
|
| 389 |
"exact_side": "pp",
|
| 390 |
"exact_cert": true,
|
| 391 |
"exact_ok": true
|
|
|
|
| 396 |
"free_coords": 8,
|
| 397 |
"grid_points_box": 740520000.0,
|
| 398 |
"grid_points_sublevel": 148257,
|
| 399 |
+
"grid_points_sublevel_est": 146267.2285954679,
|
| 400 |
"tests_budget": 149597,
|
| 401 |
"tests_togo": 24505,
|
| 402 |
+
"time_budget": 0.33132147789001465,
|
| 403 |
+
"time_togo": 0.11585521697998047,
|
| 404 |
+
"time_grid": 4.060129642486572,
|
| 405 |
"same_as_grid": true,
|
| 406 |
"same_rules": true,
|
| 407 |
"fail": false,
|
| 408 |
+
"E_star": 12.33047318175204,
|
| 409 |
"zh_cost": 16.5,
|
| 410 |
+
"f_ratio": 1.338148159992633,
|
| 411 |
"zh_side": "pp",
|
| 412 |
"zh_cert": true,
|
| 413 |
+
"exact_gap": 1.879030264717585e-11,
|
| 414 |
"exact_side": "pp",
|
| 415 |
"exact_cert": true,
|
| 416 |
"exact_ok": true
|
|
|
|
| 421 |
"free_coords": 8,
|
| 422 |
"grid_points_box": 16068375000.0,
|
| 423 |
"grid_points_sublevel": 3613342,
|
| 424 |
+
"grid_points_sublevel_est": 3748669.089120566,
|
| 425 |
"tests_budget": 1717038,
|
| 426 |
"tests_togo": 254288,
|
| 427 |
+
"time_budget": 3.0081913471221924,
|
| 428 |
+
"time_togo": 1.0414869785308838,
|
| 429 |
+
"time_grid": 71.53206396102905,
|
| 430 |
"same_as_grid": true,
|
| 431 |
"same_rules": true,
|
| 432 |
"fail": false,
|
| 433 |
+
"E_star": 12.33047318175204,
|
| 434 |
"zh_cost": 14.25,
|
| 435 |
+
"f_ratio": 1.1556734109027285,
|
| 436 |
"zh_side": "pp",
|
| 437 |
"zh_cert": true,
|
| 438 |
+
"exact_gap": 3.5847325108306904e-11,
|
| 439 |
"exact_side": "pp",
|
| 440 |
"exact_cert": true,
|
| 441 |
"exact_ok": true
|
|
|
|
| 446 |
"free_coords": 8,
|
| 447 |
"grid_points_box": 181900857600.0,
|
| 448 |
"grid_points_sublevel": null,
|
| 449 |
+
"grid_points_sublevel_est": 37444410.520439744,
|
| 450 |
"tests_budget": 9649277,
|
| 451 |
"tests_togo": 1329112,
|
| 452 |
+
"time_budget": 16.251819133758545,
|
| 453 |
+
"time_togo": 4.033153772354126,
|
| 454 |
"time_grid": null,
|
| 455 |
"same_as_grid": null,
|
| 456 |
"same_rules": true,
|
| 457 |
"fail": false,
|
| 458 |
+
"E_star": 12.33047318175204,
|
| 459 |
"zh_cost": 13.96875,
|
| 460 |
+
"f_ratio": 1.1328640672664905,
|
| 461 |
"zh_side": "pp",
|
| 462 |
"zh_cert": true,
|
| 463 |
+
"exact_gap": 6.724876211450237e-10,
|
| 464 |
"exact_side": "pp",
|
| 465 |
"exact_cert": true,
|
| 466 |
"exact_ok": true
|
|
|
|
| 471 |
"free_coords": 8,
|
| 472 |
"grid_points_box": 4119345720000.0,
|
| 473 |
"grid_points_sublevel": null,
|
| 474 |
+
"grid_points_sublevel_est": 959659286.8148656,
|
| 475 |
"tests_budget": 106403214,
|
| 476 |
"tests_togo": 12669999,
|
| 477 |
+
"time_budget": 174.84705066680908,
|
| 478 |
+
"time_togo": 40.641483545303345,
|
| 479 |
"time_grid": null,
|
| 480 |
"same_as_grid": null,
|
| 481 |
"same_rules": true,
|
| 482 |
"fail": false,
|
| 483 |
+
"E_star": 12.33047318175204,
|
| 484 |
"zh_cost": 12.9375,
|
| 485 |
+
"f_ratio": 1.0492298072669508,
|
| 486 |
"zh_side": "pp",
|
| 487 |
"zh_cert": true,
|
| 488 |
+
"exact_gap": 5.531994862195688e-10,
|
| 489 |
"exact_side": "pp",
|
| 490 |
"exact_cert": true,
|
| 491 |
"exact_ok": true
|
|
|
|
| 496 |
"free_coords": 12,
|
| 497 |
"grid_points_box": 7776.0,
|
| 498 |
"grid_points_sublevel": 0,
|
| 499 |
+
"grid_points_sublevel_est": 2.63726718062193e-05,
|
| 500 |
"tests_budget": null,
|
| 501 |
"tests_togo": null,
|
| 502 |
+
"time_budget": 0.0003662109375,
|
| 503 |
+
"time_togo": 0.0009372234344482422,
|
| 504 |
+
"time_grid": 0.0009057521820068359,
|
| 505 |
"same_as_grid": true,
|
| 506 |
"same_rules": true,
|
| 507 |
"fail": true,
|
| 508 |
+
"E_star": 3.5540533765938562
|
| 509 |
},
|
| 510 |
{
|
| 511 |
"N": 3,
|
|
|
|
| 513 |
"free_coords": 12,
|
| 514 |
"grid_points_box": 15552.0,
|
| 515 |
"grid_points_sublevel": 0,
|
| 516 |
+
"grid_points_sublevel_est": 0.0008325665716232865,
|
| 517 |
"tests_budget": null,
|
| 518 |
"tests_togo": null,
|
| 519 |
+
"time_budget": 0.00030159950256347656,
|
| 520 |
+
"time_togo": 0.0006744861602783203,
|
| 521 |
+
"time_grid": 0.0007004737854003906,
|
| 522 |
"same_as_grid": true,
|
| 523 |
"same_rules": true,
|
| 524 |
"fail": true,
|
| 525 |
+
"E_star": 3.5540533765938562
|
| 526 |
},
|
| 527 |
{
|
| 528 |
"N": 3,
|
|
|
|
| 530 |
"free_coords": 12,
|
| 531 |
"grid_points_box": 2592000.0,
|
| 532 |
"grid_points_sublevel": 0,
|
| 533 |
+
"grid_points_sublevel_est": 0.007423247182453344,
|
| 534 |
"tests_budget": null,
|
| 535 |
"tests_togo": null,
|
| 536 |
+
"time_budget": 0.0007228851318359375,
|
| 537 |
+
"time_togo": 0.0014116764068603516,
|
| 538 |
+
"time_grid": 0.03883934020996094,
|
| 539 |
"same_as_grid": true,
|
| 540 |
"same_rules": true,
|
| 541 |
"fail": true,
|
| 542 |
+
"E_star": 3.5540533765938562
|
| 543 |
},
|
| 544 |
{
|
| 545 |
"N": 3,
|
|
|
|
| 547 |
"free_coords": 12,
|
| 548 |
"grid_points_box": 30375000.0,
|
| 549 |
"grid_points_sublevel": 5,
|
| 550 |
+
"grid_points_sublevel_est": 0.10802246371827418,
|
| 551 |
"tests_budget": null,
|
| 552 |
"tests_togo": null,
|
| 553 |
+
"time_budget": 0.001940011978149414,
|
| 554 |
+
"time_togo": 0.0024421215057373047,
|
| 555 |
+
"time_grid": 0.23601126670837402,
|
| 556 |
"same_as_grid": true,
|
| 557 |
"same_rules": true,
|
| 558 |
"fail": true,
|
| 559 |
+
"E_star": 3.5540533765938562
|
| 560 |
},
|
| 561 |
{
|
| 562 |
"N": 3,
|
|
|
|
| 564 |
"free_coords": 12,
|
| 565 |
"grid_points_box": 311169600.0,
|
| 566 |
"grid_points_sublevel": 4,
|
| 567 |
+
"grid_points_sublevel_est": 3.410192677368981,
|
| 568 |
"tests_budget": null,
|
| 569 |
"tests_togo": null,
|
| 570 |
+
"time_budget": 0.00470423698425293,
|
| 571 |
+
"time_togo": 0.0024039745330810547,
|
| 572 |
+
"time_grid": 2.172592878341675,
|
| 573 |
"same_as_grid": true,
|
| 574 |
"same_rules": true,
|
| 575 |
"fail": true,
|
| 576 |
+
"E_star": 3.5540533765938562
|
| 577 |
},
|
| 578 |
{
|
| 579 |
"N": 3,
|
|
|
|
| 581 |
"free_coords": 12,
|
| 582 |
"grid_points_box": 71874000000.0,
|
| 583 |
"grid_points_sublevel": null,
|
| 584 |
+
"grid_points_sublevel_est": 442.4600113900507,
|
| 585 |
"tests_budget": 3551,
|
| 586 |
"tests_togo": 367,
|
| 587 |
+
"time_budget": 0.052869558334350586,
|
| 588 |
+
"time_togo": 0.017386674880981445,
|
| 589 |
"time_grid": null,
|
| 590 |
"same_as_grid": null,
|
| 591 |
"same_rules": true,
|
| 592 |
"fail": false,
|
| 593 |
+
"E_star": 3.5540533765938562,
|
| 594 |
"zh_cost": 12.0,
|
| 595 |
+
"f_ratio": 3.3764264991148205,
|
| 596 |
"zh_side": "pp",
|
| 597 |
"zh_cert": true,
|
| 598 |
+
"exact_gap": 0.0,
|
| 599 |
"exact_side": "pp",
|
| 600 |
"exact_cert": true,
|
| 601 |
"exact_ok": true
|
|
|
|
| 606 |
"free_coords": 12,
|
| 607 |
"grid_points_box": 1991416867440.0,
|
| 608 |
"grid_points_sublevel": null,
|
| 609 |
+
"grid_points_sublevel_est": 13968.14920650334,
|
| 610 |
"tests_budget": 31562,
|
| 611 |
"tests_togo": 2988,
|
| 612 |
+
"time_budget": 0.5058016777038574,
|
| 613 |
+
"time_togo": 0.1130678653717041,
|
| 614 |
"time_grid": null,
|
| 615 |
"same_as_grid": null,
|
| 616 |
"same_rules": true,
|
| 617 |
"fail": false,
|
| 618 |
+
"E_star": 3.5540533765938562,
|
| 619 |
"zh_cost": 8.0625,
|
| 620 |
+
"f_ratio": 2.26853655409277,
|
| 621 |
"zh_side": "pp",
|
| 622 |
"zh_cert": true,
|
| 623 |
+
"exact_gap": 0.0,
|
| 624 |
"exact_side": "pp",
|
| 625 |
"exact_cert": true,
|
| 626 |
"exact_ok": true
|
|
|
|
| 631 |
"free_coords": 12,
|
| 632 |
"grid_points_box": 340502944320000.0,
|
| 633 |
"grid_points_sublevel": null,
|
| 634 |
+
"grid_points_sublevel_est": 1812316.2066536464,
|
| 635 |
"tests_budget": 865149,
|
| 636 |
"tests_togo": 45446,
|
| 637 |
+
"time_budget": 10.929216623306274,
|
| 638 |
+
"time_togo": 2.435023069381714,
|
| 639 |
"time_grid": null,
|
| 640 |
"same_as_grid": null,
|
| 641 |
"same_rules": true,
|
| 642 |
"fail": false,
|
| 643 |
+
"E_star": 3.5540533765938562,
|
| 644 |
"zh_cost": 4.5,
|
| 645 |
+
"f_ratio": 1.2661599371680576,
|
| 646 |
"zh_side": "pp",
|
| 647 |
"zh_cert": true,
|
| 648 |
+
"exact_gap": 0.0,
|
| 649 |
"exact_side": "pp",
|
| 650 |
"exact_cert": true,
|
| 651 |
"exact_ok": true
|
|
|
|
| 656 |
"free_coords": 16,
|
| 657 |
"grid_points_box": 23328.0,
|
| 658 |
"grid_points_sublevel": 0,
|
| 659 |
+
"grid_points_sublevel_est": 3.1565665145060724e-10,
|
| 660 |
"tests_budget": null,
|
| 661 |
"tests_togo": null,
|
| 662 |
+
"time_budget": 0.00015687942504882812,
|
| 663 |
+
"time_togo": 0.000408172607421875,
|
| 664 |
+
"time_grid": 0.0020296573638916016,
|
| 665 |
"same_as_grid": true,
|
| 666 |
"same_rules": true,
|
| 667 |
"fail": true,
|
| 668 |
+
"E_star": 1.5046976757405446
|
| 669 |
},
|
| 670 |
{
|
| 671 |
"N": 4,
|
|
|
|
| 673 |
"free_coords": 16,
|
| 674 |
"grid_points_box": 2519424.0,
|
| 675 |
"grid_points_sublevel": 0,
|
| 676 |
+
"grid_points_sublevel_est": 3.149450093411821e-08,
|
| 677 |
"tests_budget": null,
|
| 678 |
"tests_togo": null,
|
| 679 |
+
"time_budget": 0.00039196014404296875,
|
| 680 |
+
"time_togo": 0.00047516822814941406,
|
| 681 |
+
"time_grid": 0.14637446403503418,
|
| 682 |
"same_as_grid": true,
|
| 683 |
"same_rules": true,
|
| 684 |
"fail": true,
|
| 685 |
+
"E_star": 1.5046976757405446
|
| 686 |
},
|
| 687 |
{
|
| 688 |
"N": 4,
|
|
|
|
| 690 |
"free_coords": 16,
|
| 691 |
"grid_points_box": 29160000.0,
|
| 692 |
"grid_points_sublevel": 0,
|
| 693 |
+
"grid_points_sublevel_est": 5.822837464473482e-07,
|
| 694 |
"tests_budget": null,
|
| 695 |
"tests_togo": null,
|
| 696 |
+
"time_budget": 0.0002722740173339844,
|
| 697 |
+
"time_togo": 0.0008375644683837891,
|
| 698 |
+
"time_grid": 0.9597537517547607,
|
| 699 |
"same_as_grid": true,
|
| 700 |
"same_rules": true,
|
| 701 |
"fail": true,
|
| 702 |
+
"E_star": 1.5046976757405446
|
| 703 |
},
|
| 704 |
{
|
| 705 |
"N": 4,
|
|
|
|
| 707 |
"free_coords": 16,
|
| 708 |
"grid_points_box": 360000000.0,
|
| 709 |
"grid_points_sublevel": 0,
|
| 710 |
+
"grid_points_sublevel_est": 2.068687430946695e-05,
|
| 711 |
"tests_budget": null,
|
| 712 |
"tests_togo": null,
|
| 713 |
"time_budget": 0.00027441978454589844,
|
| 714 |
+
"time_togo": 0.0007414817810058594,
|
| 715 |
+
"time_grid": 6.112428426742554,
|
| 716 |
"same_as_grid": true,
|
| 717 |
"same_rules": true,
|
| 718 |
"fail": true,
|
| 719 |
+
"E_star": 1.5046976757405446
|
| 720 |
},
|
| 721 |
{
|
| 722 |
"N": 4,
|
|
|
|
| 724 |
"free_coords": 16,
|
| 725 |
"grid_points_box": 233377200000.0,
|
| 726 |
"grid_points_sublevel": null,
|
| 727 |
+
"grid_points_sublevel_est": 0.00206402361321837,
|
| 728 |
"tests_budget": null,
|
| 729 |
"tests_togo": null,
|
| 730 |
+
"time_budget": 0.0009276866912841797,
|
| 731 |
+
"time_togo": 0.0021800994873046875,
|
| 732 |
"time_grid": null,
|
| 733 |
"same_as_grid": null,
|
| 734 |
"same_rules": true,
|
| 735 |
"fail": true,
|
| 736 |
+
"E_star": 1.5046976757405446
|
| 737 |
},
|
| 738 |
{
|
| 739 |
"N": 4,
|
|
|
|
| 741 |
"free_coords": 16,
|
| 742 |
"grid_points_box": 81335585358720.0,
|
| 743 |
"grid_points_sublevel": null,
|
| 744 |
+
"grid_points_sublevel_est": 1.3557349947452255,
|
| 745 |
"tests_budget": null,
|
| 746 |
"tests_togo": null,
|
| 747 |
+
"time_budget": 0.028728961944580078,
|
| 748 |
+
"time_togo": 0.012426614761352539,
|
| 749 |
"time_grid": null,
|
| 750 |
"same_as_grid": null,
|
| 751 |
"same_rules": true,
|
| 752 |
"fail": true,
|
| 753 |
+
"E_star": 1.5046976757405446
|
| 754 |
},
|
| 755 |
{
|
| 756 |
"N": 4,
|
|
|
|
| 758 |
"free_coords": 16,
|
| 759 |
"grid_points_box": 7879889144531250.0,
|
| 760 |
"grid_points_sublevel": null,
|
| 761 |
+
"grid_points_sublevel_est": 135.26785151587907,
|
| 762 |
"tests_budget": 4279,
|
| 763 |
"tests_togo": 462,
|
| 764 |
+
"time_budget": 0.3286888599395752,
|
| 765 |
+
"time_togo": 0.08047604560852051,
|
| 766 |
"time_grid": null,
|
| 767 |
"same_as_grid": null,
|
| 768 |
"same_rules": true,
|
| 769 |
"fail": false,
|
| 770 |
+
"E_star": 1.5046976757405446,
|
| 771 |
"zh_cost": 5.8125,
|
| 772 |
+
"f_ratio": 3.862902225285454,
|
| 773 |
"zh_side": "mm",
|
| 774 |
"zh_cert": true,
|
| 775 |
+
"exact_gap": 0.1617328761987491,
|
| 776 |
"exact_side": "mm",
|
| 777 |
"exact_cert": true,
|
| 778 |
"exact_ok": false
|
|
|
|
| 783 |
"free_coords": 16,
|
| 784 |
"grid_points_box": 5.882921604607162e+18,
|
| 785 |
"grid_points_sublevel": null,
|
| 786 |
+
"grid_points_sublevel_est": 88849.44861562307,
|
| 787 |
"tests_budget": 208929,
|
| 788 |
"tests_togo": 10144,
|
| 789 |
+
"time_budget": 9.055202007293701,
|
| 790 |
+
"time_togo": 1.618084192276001,
|
| 791 |
"time_grid": null,
|
| 792 |
"same_as_grid": null,
|
| 793 |
"same_rules": true,
|
| 794 |
"fail": false,
|
| 795 |
+
"E_star": 1.5046976757405446,
|
| 796 |
"zh_cost": 3.75,
|
| 797 |
+
"f_ratio": 2.4921949840551316,
|
| 798 |
"zh_side": "pp",
|
| 799 |
"zh_cert": true,
|
| 800 |
+
"exact_gap": 9.77978809046931e-10,
|
| 801 |
"exact_side": "pp",
|
| 802 |
"exact_cert": true,
|
| 803 |
"exact_ok": true
|
globmp/gridstart/run.py
CHANGED
|
@@ -19,7 +19,11 @@ import os
|
|
| 19 |
import time
|
| 20 |
from multiprocessing import Pool
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
REL = 1e-4 # success: final cost <= E*(1 + REL)
|
| 25 |
PLAIN_MAX_PAIRS = 1e11 # run the plain budget rule only below this many state pairs
|
|
@@ -69,9 +73,9 @@ def stage_check(a):
|
|
| 69 |
print(f'N={N} d_f={p.d_f} free={p.n * p.d_f} cost_err={e1:.1e} chart_err={e2:.1e} togo_err={e3:.1e} togo_lb={ok3} '
|
| 70 |
f'piece_test_agree={int((mine[:600] == ref).sum())}/600 free_frac={mine.mean():.3f} fmin={q.fmin:.4f} (x N^3 = {q.fmin * N ** 3:.4f})', flush=True)
|
| 71 |
for N, h, U in ((1, 1.0, 600.0), (2, 2.0, 80.0), (2, 1.25, 60.0)):
|
| 72 |
-
xb, cb, sb =
|
| 73 |
for rule, imp in (('budget', False), ('togo', True)):
|
| 74 |
-
xd, cd, sd =
|
| 75 |
print(f'N={N} h={h} U={U} rule={rule}: grid {cb} ({sb["grid_points_sublevel"]} pts, {sb["time"]:.1f}s) | INIT {cd} '
|
| 76 |
f'({sd.get("tests")} tests, {sd["time"]:.1f}s) same_cost={cb == cd or (cb is not None and abs(cb - cd) < 1e-9 * cb)} '
|
| 77 |
f'same_point={xb is not None and np.allclose(xb, xd)}', flush=True)
|
|
@@ -100,12 +104,12 @@ def job(args):
|
|
| 100 |
S = [float(np.prod(cnt[idx_joint(j, N)])) for j in range(N + 1)]
|
| 101 |
pairs = sum(S[j] * S[j + 1] for j in range(N)); npts = float(np.prod(cnt))
|
| 102 |
res = dict(N=N, h=h, U=U, E_star_routes=Es, states_per_joint=S, pairs=pairs, grid_points_box=npts, grid_points_sublevel_est=q.sublevel_count(U, h))
|
| 103 |
-
x, c, st =
|
| 104 |
if pairs <= PLAIN_MAX_PAIRS:
|
| 105 |
-
x2, c2, st2 =
|
| 106 |
res['budget_equals_togo'] = bool((x is None and x2 is None) or (x is not None and x2 is not None and abs(c - c2) <= 1e-9 * abs(c)))
|
| 107 |
if npts <= BRUTE_MAX_POINTS:
|
| 108 |
-
xb, cb, sb =
|
| 109 |
res['grid_equals_init'] = bool((x is None and xb is None) or (x is not None and xb is not None and abs(c - cb) <= 1e-9 * abs(c)))
|
| 110 |
if x is not None:
|
| 111 |
p = build(N); G = x_to_G(x, N); Z = G_to_Z(p, G)
|
|
|
|
| 19 |
import time
|
| 20 |
from multiprocessing import Pool
|
| 21 |
|
| 22 |
+
import numpy as np
|
| 23 |
+
|
| 24 |
+
from .exact_repair import exact_descent
|
| 25 |
+
from .init import init, plain_grid
|
| 26 |
+
from .instance import *
|
| 27 |
|
| 28 |
REL = 1e-4 # success: final cost <= E*(1 + REL)
|
| 29 |
PLAIN_MAX_PAIRS = 1e11 # run the plain budget rule only below this many state pairs
|
|
|
|
| 73 |
print(f'N={N} d_f={p.d_f} free={p.n * p.d_f} cost_err={e1:.1e} chart_err={e2:.1e} togo_err={e3:.1e} togo_lb={ok3} '
|
| 74 |
f'piece_test_agree={int((mine[:600] == ref).sum())}/600 free_frac={mine.mean():.3f} fmin={q.fmin:.4f} (x N^3 = {q.fmin * N ** 3:.4f})', flush=True)
|
| 75 |
for N, h, U in ((1, 1.0, 600.0), (2, 2.0, 80.0), (2, 1.25, 60.0)):
|
| 76 |
+
xb, cb, sb = plain_grid(N, h, U)
|
| 77 |
for rule, imp in (('budget', False), ('togo', True)):
|
| 78 |
+
xd, cd, sd = init(N, h, U, rule=rule, improve_only=imp)
|
| 79 |
print(f'N={N} h={h} U={U} rule={rule}: grid {cb} ({sb["grid_points_sublevel"]} pts, {sb["time"]:.1f}s) | INIT {cd} '
|
| 80 |
f'({sd.get("tests")} tests, {sd["time"]:.1f}s) same_cost={cb == cd or (cb is not None and abs(cb - cd) < 1e-9 * cb)} '
|
| 81 |
f'same_point={xb is not None and np.allclose(xb, xd)}', flush=True)
|
|
|
|
| 104 |
S = [float(np.prod(cnt[idx_joint(j, N)])) for j in range(N + 1)]
|
| 105 |
pairs = sum(S[j] * S[j + 1] for j in range(N)); npts = float(np.prod(cnt))
|
| 106 |
res = dict(N=N, h=h, U=U, E_star_routes=Es, states_per_joint=S, pairs=pairs, grid_points_box=npts, grid_points_sublevel_est=q.sublevel_count(U, h))
|
| 107 |
+
x, c, st = init(N, h, U, rule='togo', improve_only=True); res['init_togo'] = dict(cost=c, x=None if x is None else x.tolist(), **st)
|
| 108 |
if pairs <= PLAIN_MAX_PAIRS:
|
| 109 |
+
x2, c2, st2 = init(N, h, U, rule='budget', improve_only=False); res['init_budget'] = dict(cost=c2, x=None if x2 is None else x2.tolist(), **st2)
|
| 110 |
res['budget_equals_togo'] = bool((x is None and x2 is None) or (x is not None and x2 is not None and abs(c - c2) <= 1e-9 * abs(c)))
|
| 111 |
if npts <= BRUTE_MAX_POINTS:
|
| 112 |
+
xb, cb, sb = plain_grid(N, h, U); res['grid'] = dict(cost=cb, x=None if xb is None else xb.tolist(), **sb)
|
| 113 |
res['grid_equals_init'] = bool((x is None and xb is None) or (x is not None and xb is not None and abs(c - cb) <= 1e-9 * abs(c)))
|
| 114 |
if x is not None:
|
| 115 |
p = build(N); G = x_to_G(x, N); Z = G_to_Z(p, G)
|