# Find an algorithm which returns the weight of a lightest path between all paths with a weight divided by three [duplicate]

Question: Find an algorithm which returns the weight of a lightest path between all paths with a weight divided by three in a graph with natural weights of the edges.

My instructor has given me a hint of doing calculations modulo three and creating a new graph and applying Dijkstra's algorithm on it.

I have no idea how to solve this question and I would be happy to get your help with a hint or a direction.

Thank you

• What did you try? Where did you get stuck? We're happy to help you understand the concepts but just solving exercises for you is unlikely to achieve that. You might find this page helpful in improving your question. – Nathaniel Jun 5 at 9:40
• Perhaps I wasn't clear in my question. I agree, I want to learn through solving this question so it would not be useful for me to get a full solution. I would be happy to hear a direction or a hint for solving. I edited my question. – FAF Jun 5 at 9:44
• I don't know what "the weight of a lightest path between all paths" means. Where did you encounter this task? I suggest crediting the source. – D.W. Jun 6 at 5:58