snapapps / edgy

a visual programming language inspired by Scratch
http://snapapps.github.io/
GNU Affero General Public License v3.0
51 stars 21 forks source link

Hamiltonian circuit with backtracking search #404

Closed stevenbird closed 8 years ago

stevenbird commented 8 years ago

There is a backtracking algorithm that explores all possible hamiltonian paths by using DFS on a decision tree (this tree is just the call graph of the algorithm, it is not instantiated):

image

Please create a new Edgy example for this algorithm.

stevenbird commented 8 years ago

Thanks @cyderize. I'd like to refine this a little, making less use of global variables. Could the current node and the path so far be make formal parameters for the block? I think it's fine to accumulate the results in a global variable.

cyderize commented 8 years ago

Yes, that would make a lot of sense to do.

I'll open a new PR with a revised example.

stevenbird commented 8 years ago

Actually, the result list works as a third parameter too, and this is probably cleanest.

stevenbird commented 8 years ago

Closed by #413.