added dereference counters to bfs & dijkstra