I was given the next assignment:
Let $G=(V,E)$ be an undirected graph and connected,such that every $e\in E$ has a color-blue or red.
Given the same $G$ and some $a,b\in V$ ,construct an efficient algorithm that finds, out of all of the paths with the minimal amount of red edges from $a$ to $b$,a path with the minimal amount of blue edges.
I tried answering but got stuck. Any help will be very appreciated!
- I'm only allowed to use BFS/DFS