An open API service indexing awesome lists of open source software.

https://github.com/smaranjitghose/autoprompicker

Using Python to set unbreakable pairs for prom night
https://github.com/smaranjitghose/autoprompicker

Last synced: 3 months ago
JSON representation

Using Python to set unbreakable pairs for prom night

Awesome Lists containing this project

README

        

# AutoPromPicker
Remember Prom Night? ๐ŸŽถ

One of the major issues โš” we faced was to ensure that all the handsome boys๐Ÿคต were paired to all the gorgeous girls๐Ÿ’ƒ in a way that took care of everyone's priority ๐Ÿ’› and they don't break up for the night.

"Nah! That's just a fairytale scenario". Well I agree but python ๐Ÿcan help out to a great extent.

As any other wizard๐Ÿง™โ€โ™‚๏ธ , python requires you to follow some rules โ—for this spell to work:

- The number of boys and girls must be equal. We don't want anyone to be left out in the corner. ๐Ÿ’”
- Everyone should be brutually honest when asked about ranking their counterparts in order of preferrence.
- The guys get to propose the girls ( We can flip this if required)

# Some Theorical Background: ๐Ÿ”

Our situation is an application of the popular [Stable Marriage Problem](https://en.wikipedia.org/wiki/Stable_marriage_problem). It can be solved by the[Gayle-Shapely algorithm](https://en.wikipedia.org/wiki/Gale%E2%80%93Shapley_algorithm) given below:

```
Initialize all m โˆˆ M and w โˆˆ W to free
while โˆƒ free man m who still has a woman w to propose to do
w := first woman on m's list to whom m has not yet proposed
if w is free then
(m, w) become engaged
else some pair (m', w) already exists
if w prefers m to m' then
m' becomes free
(m, w) become engaged
else
(m', w) remain engaged
end if
end if
repeat
```

# Usage:

Convinced..huh? ๐Ÿ˜‰ and want this spell for yourself?

![usage](https://media.giphy.com/media/H2SiDhuGVJRWU/giphy.gif)

Here you go:

- clone or Download this repo โฌ
- Open the Terminal ๐Ÿฑโ€๐Ÿ’ป
- Move inside ๐Ÿ‘‰ the repo
```cd AutoPromPicker```
- Open ```autoprompick.py``` and change the names of the girls,boys and preferences as desired๐Ÿงฑ
- Now, the climax you have been waiting for!๐Ÿ˜Ž. Run the script using Terminal
```python autoprompick.py```
- Abracadabra โšก

**I assume you have python installed on your system and set to path.**

# Further Work: ๐Ÿ—
- Tune this script to take in the number of girls and boys from the terminal,their names and preference of each
- Create a GUI for this
- Deploy๐Ÿšข the above using Streamlit
- Create an end to end auto prom picker system, where the ```N``` boys and ```N``` girls register themselves,put up their profile,rate each other and our script takes those values and gives them their best pair(s) as per precedence of ask out

# License ๐Ÿ“œ

[MIT License](https://github.com/smaranjitghose/AutoPromPicker/blob/master/LICENSE)

# **Crafted with โค by Smaranjit Ghose**