If you are given a weighted and directed graph, which can have multi-edges between nodes. Each edge will have a color associated with it (let it be i). Find the shortest path between node A and node B, if there are multiples shortest paths, print the shortest path with the least number of colors in it. What can be the optimized solution for this?
Anything better than finding all shorted paths and then iterating thru each one and finding different colors for each, and printing the one with the least number of colors..?
If there's a similar question on the internet and someone can provide me a link for that, it would be really helpful.