Güven Tuncay

What I Learned from Building a Route Optimization Project

During my university years, I worked on several projects with friends. This post shares my experience with a route optimization project and the lessons learned from it.

The Idea: Route Optimization for Food Delivery

In my graduation year at university, food delivery services were extremely popular and they still are. My three friends and I worked on a route optimization project aimed at improving package delivery for couriers. We planned to develop software that could be integrated with well-known food delivery services like Yemeksepeti and Trendyol. This software would take customer orders and utilize an AI service to create the most efficient delivery routes.

Technical Implementation

Development Journey

I had nearly a year of professional development experience, but I had never developed such a comprehensive app on my own before. In my daily job, project managers would plan the work and tell me what to do. However, I had to determine how I was going to build this project by myself.

Architecture Design

I discovered that beginning with a database design is most beneficial for me. Once I understand the data I will be storing, it becomes easier to visualize the project flows. Having seen and built various software architectures lately, I can now easily identify the appropriate flows for an application.

Our team had a meeting to discuss database design. We began by sketching out a few tables, such as "user" and "order." After that, we created the flow for the mobile application. I also developed several endpoints for both the mobile app and the AI service.

Technical Deep Dive

This project was an assignment for the university, and while security and deployment were not required, I was eager to implement them. I integrated OAuth2 with Spring Security and deployed the application on AWS EC2. I learned a great deal during this process, as it was a completely different experience from simply watching a video and trying to replicate it.

The free tier EC2 instances at that time came with either 1 GB or 500 MB of memory, which presented a challenge for running both a Python AI server and a Java backend. As a student on a tight budget, I had to get creative with resource optimization. I ended up implementing a swap space solution to extend the available memory. While not the most elegant solution, it worked for our proof of concept. Looking back, I would now opt for vertical scaling or perhaps use GraalVM for better resource efficiency. But, sometimes the most interesting solutions come from working within constraints.

Results and Testing

To assess the effectiveness of the AI service, we chose random locations from OpenStreetMap to simulate order deliveries. We compared the routes generated by the AI service with those created randomly. While we observed a 80% reduction in delivery time, this comparison wasn't entirely valid, as no one does create such routes, right?

Route Optimization Comparison: Random vs AI-Generated Routes

We should at least attempt to map the best route as humans and compare it with a computer solution. This would provide a realistic comparison.

Lessons Learned

1. Understanding Priorities

It is always good to know priorities.

I am not sure if it was a mistake, but it is always helpful to understand priorities. Since this was primarily a university project, there was no need for security implementation or AWS deployment. I didn't have to deal with AWS network configuration, but I learned a lot in the process. I made a similar over-engineering mistake in my next project as well and gained a valuable lesson from it.

2. Technical Growth

This project was my first significant undertaking, and it taught me a great deal about software architecture design, project planning, and resolving bugs. At the time, there were no generative AI tools like ChatGPT or Cursor to assist me; I had to develop the design and architecture on my own. Working on this and other side projects has greatly improved my skills and has been beneficial for my career.

What Would I Do Differently?

  1. Focus on Core Requirements: Instead of implementing security and deployment features that weren't required for the university project, I should have focused on the core functionality first.

  2. Better Resource Planning: I should have researched the AWS free tier limitations more thoroughly before starting the deployment. This would have saved time spent on workarounds like swap space configuration.

  3. Realistic Testing: Instead of comparing AI routes with random routes, I should have created a baseline using actual delivery routes from couriers to make the comparison more meaningful.

Conclusion

I don't recall the exact reason we decided to close this project, but it wasn't very exciting to engage with local businesses, sell the service, create integrations, or reach out to food delivery services. Instead, we chose to focus on finding jobs after graduation and postponed our startup dreams for a more promising idea in the future.

Discussion

No comments yet

Be the first to share your thoughts!