Algorithm for locating the closest destination(s) to source(s) and resolving conflicts in case a single destination is mapped to multiple sources
问题 Problem Statement: Given a matrix of people(denoted by small alphabets) and bikes(denoted by capital alphabets), find the nearest bike for a given person. How will you change your solution if you have to find bikes for a set of people? (assuming multiple bikes can be at the same distance from 1 person)? I know Dijkstra's algorithm and Bellman Ford's algorithm, but curious about the implementation here. Or can it be solved by BFS(Breadth First Search)? 回答1: To assign a single bike to a single