15,848,483 members
See more:
Recently, I got a challenge to develop an algorithm to reduce the waiting time of the payment line of a supermarket. I was planning to use a genetic algorithm, but I want to know if this should be the approach to the problem. I don't know in which programming language I'm going to implement, but I am open to suggestions.

The data that I am going to use to work the problem are: the number of payment boxes that are open and the time in hours.
The objective is to obtain the lower time we can find, but if needed, I can invent data. However, I want to keep it simple.

By the way, it's a single line with multiple payment boxes, like the system you see in some supermarkets where you have a single line to multiple payment boxes. The payment boxes that are available are indicated by a monitor to the client.

What I have tried:

I was thinking about something like this:

```2 1 4 6 - number of payment boxes
3 4 2 3 - time in hours```

Are these two enough for my implementation to obtain the best fitness value that gives the lowest time?
Posted
Updated 24-Jan-22 4:27am
v2
BillWoodruff 23-Nov-21 7:51am
You need to research genetic algorithms, select a programming language, and start experimenting. When you have code to show, and specific questions, come back here.

See those link to the right under "related question:" start there.
Gerry Schmitz 23-Nov-21 12:57pm
It's "Queueing Theory". You need "arrival rates" and "service times".

## Solution 1

Quote:
develop a algorithm to reduce the waiting time of the payment line of a supermarket

Solution: open all payment boxes.

Hint: I think you failed to mention restrictions, limitations and the optimization target.

If you want help to implement an optimization algorithm, the first thing you need to do is specify a cost function, i. e. a function that determines the value of a specific solution candidate. The purpose of this function is to determine how much better one candidate is when compared to another candidate, or at least whether that candidate is better or not.

Without such a function, there is no way to judge whether you found the solution, and therefore no way we can help you find an algorithm.