I am using Dijkstra algorithm in a program.suppose i have a graph with vertices and edges.if we imaging all the edges starting from source vertex "a" are as below
a-->b
a-->c and
a-->d
and all the edges ending to vertex "f" are :
b-->f
m-->f
e-->f
w-->f
what i need is i know from beginning that i want the edge a-->b as my starting edge (assume "a" as start point )so do not need to search for the other neighbors of "a" i.e. a-->c and a-->d also i only want paths which end to m-->f (assume "f" as the destination)i.e. i do not want the path containing b-->f ,m-->f,e-->f,w-->f so is it a good idea to trim my initial graph as such it doesn't contain these edges and then apply dijkstra on that. actually finding these edges needs some searches. I wonder if it is worth(considering time or cpu usage) dong searches and trimming my graph or there is a better way.