Extend node searching stuff to handle nonlinear nodes

as titled. Node-distance based search length is required for nonlinear nodes, because nonlinear nodes are located between end points of edges.