There are n activities and m students. Each student can do as many activities as possible. I want to figure out the shortest path is between two students. I need to focus on inserting time of the activities: students and the time to find the shortest path between two students. Example: Activity1: Bob,Carl, Anthony, Suzy, David Activity2: Bob, Manny, carl Bethany brad Activity3: Carl, Craig, Candy
Given this if I wanted to find shortest path between Anthony to craig would be Anthony-> Activity1-> Bob -> Activity2-> Carl-> Activity3-> Craig What would be the best data-structure to first insert this and then do the queries for shortest path? I believe its a graph but what type and how would I format it?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.