ADD: dijkstra tuple resource algorithm