Problem statement: Bike drop distance optimisation
Using Python, please optimise for the following: In the df1, you have the bikes and its pickup locations. In df2, you have the drop locations. You have to assign a drop location from df2 to every bike present in df1 in such a way that it meets all the below conditions.
Df1: Bike pickup locations (excel attached)
Df2: Bike drop locations (excel attached)
Constraints:
1.
Hex with avg daily sessions/supply Minimum no. of bikes should be drop Maximum no. of bikes can be drop
>120 6 8
[100 to 120) 2 4
[50 to 100) 2 3
[30 to 50) 1 2
[20 to 30) 1 1
[10 to 20) 0 1
<10 0 0
2. You have to always aim for the maximum number of bikes to be dropped in the respective destination hex but if the drop distance is more than 4km you will have to assign a different drop hex to it.
Comments
Leave a comment