Re: can-of-worms
- From: Ray Dillinger <bear@xxxxxxxxx>
- Date: Fri, 07 Jul 2006 20:09:29 -0700
Drew Krause wrote:
Ken Tilton wrote:
Constraints? All numeric all the time? Looking for shorter paths? Is func1 always to be applied to the output of func2 applied to all atoms? no. sorry. but howseabout func1 always applied to ((output of func2 applied to any number of atoms) and any number of atoms)? No iteration in the final form? etc etc.
OK. To lay bare the problem I'm working on, I have:
a starting node,
and ending node,
several unary operations that can act on the first or any intermediate steps,
and no other restrictions that I'm aware of (*except* that failure is a possibility)
so for example, tg = target, s = start, op1...opn = operations
solution might look like tg = (op2 (op1 (op7084 (op10 (op2 (op5 s))))))
.. and yes, shortest path would be nice, but ITWICG (I'll take what I can get)..
sounds like an A* problem. A* (A-star) is a search algorithm
that finds optimal paths in maze or near-maze conditions. It's
basically an optimization of breadth-first search.
What it consists of is keeping a set of reachable points (numbers
in this problem domain, I guess) ordered by an estimate as to the
minimum possible number of steps from each point to the solution
space. You use some kind of heuristic to come up with the estimate.
You repeatedly take the point with the smallest estimate, apply your
possible moves to that point to give you new points, apply your
heuristic to the new points to give estimates of remaining-steps
for each, and then repeat.
The heuristic is key. As long as it's conservative (smaller than
the actual number of steps required to get there from that point)
the algorithm is guaranteed to find the shortest path.
Bear
.
- Follow-Ups:
- Re: can-of-worms
- From: Drew Krause
- Re: can-of-worms
- References:
- can-of-worms
- From: Drew Krause
- Re: can-of-worms
- From: Pascal Bourguignon
- Re: can-of-worms
- From: Drew Krause
- Re: can-of-worms
- From: Ken Tilton
- Re: can-of-worms
- From: Drew Krause
- can-of-worms
- Prev by Date: Re: Why is lisp better than java perl or python or ruby?
- Next by Date: Re: efficiently accumulating values
- Previous by thread: Re: can-of-worms
- Next by thread: Re: can-of-worms
- Index(es):
Relevant Pages
|