Hopefully these names are better.. but it's worrying that they're so unwieldy-sounding. I might be deep down a local optimum, and missing a much more elegant solution.
U32AYLUP4N32MVWH5WFCKP64CW4XO3CCV2AVQ357CMCY7CUBSYJQC
YR62G4PUZEC2PMXMLTPUKFYTSQ3YTCAXXFGLZOIQTUOM2FABPNFQC
3AOSRXSHG5UYYVLV5RIDCPEG2NB7H3K23QF7V6EOJCP24TVP5U6QC
FKENDSMEJXEZPAT6K5TYJC2KZBVYKMXA7LN7ZVPZMYIBODWIB64AC
3CIDHIL2YPGFIPMVPGROBQPUGPGF5OPDQXHSRCQ7EVLNKJ6XDNHQC
BUPMQLGRZJFGYEY7DI7YV7V3URUE5HVT2AFQHQBG2GORLNSRW7VAC
RCEWATRPX3MDVMAIEBEYIRL2MXPQYD47IU7XQUKSUZVFJRU4AN4AC
AHABKD5VEK5RSTM3CME4XJAHCVTHYV2D2WAWUGSJ6PBUCUI7CB3AC
DGJOMSMTXML2XLFFUGCOI477TB55YZ4ZXVBTLQVAIHEWJWBE3KQAC
io.stdout:write(tostring(i)..' '..tostring(min_index)..' '..tostring(#cands)..' '..tostring(crate.id)..' ')
io.stdout:write(tostring(i)..' '..tostring(crate.x)..','..tostring(crate.y)..' '..tostring(crate.id)..' '..tostring(p.x)..','..tostring(p.y)..' '..tostring(c.x)..','..tostring(c.y)..' ')