Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
initialize priority queue Q with a single entry: r(0, r0, q0)
initialize segment list S to empty
until Q is empty
pop smallest r(ti, ri, qi) from Q (i.e., smallest ‘t’)
accepted = localConstraints(&r)
if (accepted) {
add segment(ri) to S
foreach r(tj, rj, qj) produced by globalGoals(ri, qi)
add r(ti + 1 + tj, rj, qj) to Q
local R = function( ti, ri, qi ) return { t = ti, r = ri, q = qi } end
local Q = { R( 0, ??, ?? ) }
local S = {}
local r = Q:pop()
accepted = localConstraints( r )
if (accepted) then
S:add( r )
local potential_rs = globalGoals( r.r, r.q )
for _,v in pairs(potential_rs) do
Q:add( v )
-- pop new potential road with smallest 't'
r = Q:pop()
while (r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment