Inspiration

Staying at home is now more important than ever; however, supermarkets are still full of people buying and stocking their groceries which makes it even harder to fight COVID-19.

What it does

Mini Food finds the best 10 meals that use _ the least quantity _ of ingredients you have at home; it helps families stay safe by avoiding to go out frequently to buy groceries.

How I built it

We started 2 days ago with only an idea in our minds and a great motivation. We decided to use React Native to build the app since it's much faster to use than building it with Java, we used Python and Flask for the backend.

We've also used the Spoonacular API to retrieve recipes by ingredients and we computed a weighted score for every recipe returned; in this score we penalize the use of missing ingredients and we take into account the number of people who liked it (on a logarithmic scale), the quantity of ingredients used and the ingredients that weren't used.

Then we get the best 10 recipes based on this score. We've done a lot of trials to find the best coefficients for each term but we are planning to make this approach more formal and smarter.

Challenges we ran into

A major problem we ran into is the lack of a database of recipes with ingredient quantities, we found several datasets but they all had a major issue: ingredients were not numerical, it was a list of natural language sentences and we had to use a trained model to convert them into a logical structures to process but due to the lack of time we couldn't afford to do it and we used an API to retrieve recipes.

Another challenge was the logic behind finding the most economic recipes from the provided data while taking into account the quantity of ingredients that the user has, even though this sounds easy, it's not that easy to model. A good approach would have been to treat this problem as a multidimensional knapsack problem where each input is a recipe and each ingredient is dimension but this problem is NP complete and will take too much time to compute in a short time for several ingredients (higher dimensions).

Accomplishments that we're proud of

One of the accomplishment we're proud of is that we got to learn more about optimization problems besides the fact that we built this app in merely 2 days of hacking with a poor internet connection (my country has a poor internet speed unfortunately).

What's next for Mini Food

  • Choosing the menu of the week and generating a list of missing ingredients to buy

  • Importing ingredients to the app using a bill picture

We're also thinking to build our own database by scraping recipes from several sources online or using already existing datasets and building a smarter searching algorithm that yields better results and get rid of the API, we're open if anyone with some expertise wish to join us after this hackathon (CGH 1.0).

Built With

Share this project:

Updates