Corrected a bug inside the edge combination function which causes wrong bahaviour when some location has no outgoing edges.