Add algorithms

return has_edge == -1