Artificial intelligent assistant

The Generalized Jug Problem - a different question > “If you have a ve-liter and a three-liter bottle and plenty of water, how can you get four liters of water in the ve-liter bottle?” We (all) know this problem, and its natural generalization, > “Given a p-liter and q-liter jug what amounts of water can be obtained?” My question is different. I would like to know if there's a way to obtain the minimum number of operation to fill one between **p** and **p** jug with **c** liters. Only allowed operation are: 1. Overfill a **n-liter** jug with **n-liter** 2. **Empty** a jug 3. **Pour** from a jug to another while the first one is empty or the other is full. Thanks for your attention.

By hand, this is most likely not possible. However, if you use a computer, you can use depth first search to look at all the possible first moves, possible second moves, possible third moves. At some point, you would have found the minimum number of operations required. The downfall to this method is that it has an exponential run-time.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 415da6df34680a6d0b150615715cb18d