Designing a carpooling app: How do I match data?

I want to teach children how to design a carpooling app for going to school. The assigned task is to design a carpooling app for 1000 students in the entire school, allowing students willing to provide rides and those in need of rides to be matched. We are using App Inventor to design the mobile interface and program. The fields for students to input include: student name, friend's name, offering or needing a ride, ride time, and pick-up location. After data input, it is transmitted to Google Sheets and then the matching process takes place. The matching condition is that students must be friends to be paired. Successfully matched students are recorded in another sheet, and students are notified through App Inventor.
Currently, the mobile interface design is complete, and users can input student name, friend's name, offering or needing a ride, ride time, and pick-up location on the app, and the data can be written to Google Sheets via a spreadsheet. However, the next step is how to read and match the data. I would like to request the assistance of experts in this matter.

Show us the sheet designs, by sheet name and column name, hopefully in English?

how to be friends ?

Sheet1 are raw data ,Sheet2 are pairing results.

So you have no car seats for extra passengers?

Who decides who is a friend?

The driver, I imagine?

Otherwise a driver would be swamped with friends

This might fall into the category of Packing problems.

carpool algorithms

1 Like

I take issue with mixing friend links with time and place pickup appointments.

Can friendship exist without regard for pickup and dropoff?

Would there be a mechanism for people to apply to be a friend of a driver?

I am reminded of a now obsolete sample app involving trading of excess pizza slices among a group of students. (You would use rides instead of pizza slices, and Google Sheets instead of the obsolete Fusion Tables.)

Thank you very much for your assistance.

For inspiration, you can take a look at to a similar project (also done with several thousand of app inventor blocks) .
The concept is that to share a daily trip, the user only has to press a button ("I`m leaving now" for the car driver, or "I'm ready to be picked up" for a passenger).
As a hint, it is about emulating hitchhiking with the help of an app, and friendship is not in the equation (It is replaced by a user reputation system, based on the ratings of travel mates at the end of the trip). The key for matching them in real time is the passenger is ready when the car is one minute away from the pick-up point, and both go in the same direction. Thus, many more can travel together, because it is no longer necessary to know each other, or even be neighbors and co-workers.

Thank you for your advice.