Extend node searching stuff to handle nonlinear nodes

as titled and created from #477. Node-distance based search length is required for nonlinear nodes, because nonlinear nodes are located between end points of edges.
Comment concerning the return type does not match implementation.