Search⌘ K
AI Features

Challenge: Basic Graph Algorithms

Explore how to apply a modified Dijkstra’s algorithm to solve graph problems involving teleport paths between galaxies. Learn to minimize teleports while ensuring total costs meet specific modular conditions. Gain hands-on experience implementing this algorithm in C++ and analyze its time complexity.

Let's practice what we have learned so far.

Task

There are nn galaxies connected by mm intergalactic teleport-ways. Each teleport-way joins two galaxies and can be traversed in both directions. Also, each teleport-way ee has an associated cost of c(e)c(e) ...