bidirectional searching time dependent