All pastes #488508 Raw Edit

Vorn

public python v1 · immutable
·published 2007-05-15 01:32 UTC
rendered paste body
def depth_search(graph, current, target, previous = None):  if current == target:    return (current,)  for next in graph.neighbors(current):    if next != previous:      path = search_nodes(graph, next, target, current)    if path:      return (current,) + path  return None