Add depth-first search

* Note! Program works on and off, can't find the bug that sometimes
cause the constrain algorithm to go down to null