Hi I'm a computer science student, in my second year. During my studies, I got stuck with a question I couldn't solve, a question I was exposed to in order to expand my knowledge. Question: There is an undirect graph, with edges of positive weight, I have to find I am the minimum distance between, in addition The graph has 2 types of edges - blue and green. I need to find a minimum distance between and also the number of its green edges in the tree is even.

I was thinking of an algorithm based on the Dijkstra algorithm. Let's start from s Each time we go to the bow with the minimum number. If we have to go to a green vertex - right after that we try to go - to another green vertex.

I tried to draw my idea but it didn't work properly.
Why doesn't my idea work properly? what am I missing? Thanks for the help.

