You have 5 liter of petrol and want to travel to the farthest place possible, one side trip. Given places and the distance between them like Bangalore, Mysore, Pondicherry, Waynad. Given your starting point as Bangalore choose which destination you will be able to travel to given the mileage of car as 20km/liter.
- Which other algorithm can be used here?
Graph algorithm idea, Food vertex, points to burger and pizza vertex with prices as edges, then there are vertex like cheese and vegetables for additional topups, find the most optimal way to find least cost food. Above can have multiple data like rating to allow optimisation based on rating, same can be stored as additional parameters of the tuple.