The Need for Seed is a racing video game set in the fictional Fortune City. You, as a player of the game, need to carry seeds to the farmers by driving your car from one town to another. There are NNN towns in Fortune City conveniently numbered from 000 to N−1N-1N−1. The towns are connected by MMM weighted bidirectional roads. Each town has a unique positive integer difficulty level, diffdiffdiff. The time taken to go from one town to another can be different. When you drive from town uuu to town vvv, you will face obstacles if diff[u]<diff[v]diff[u] < diff[v]diff[u]<diff[v]. The weight of each road denotes the time taken to go from one town to another.
This is a companion discussion topic for the original entry at https://toph.co/p/the-seed-for-need