| Algorithm 1 RRT* | |
| 1: | G ← (V, E); V ← xinit; |
| 2: | for i = 1 to n do |
| 3: | xrand ← Sample(i); |
| 4: | xnearest ← Nearest(V, xrand); |
| 5: | (xnew, σ) ← Steer(xnearest, xrand); |
| 6: | if CollisionFree(σ) then |
| 7: | Xnear ← Near(V, xnew); |
| 8: | (xparent, σparent) ← ChooseParent(Xnear, xnearest, xnew, σ); |
| 9: | V ← AddVertex(xnew); |
| 10: | E ← AddEdge(xparent, xnew); |
| 11: | G ← Rewire(G, xnew, Xnear); |
| 12: | end if |
| 13: | end for |
| 14: | return G; |