GraphAware Blog - Optimisation Problems

Find out what's new in the Neo4j world

Solving the bucket-filling problem with Neo4j

02 Sep 2018 by Vince Bickers Neo4j State Machine Optimisation Problems Shortest Path

Introduction In the bucket filling problem you are given two empty buckets, each of a certain capacity, and a large supply of water. By filling, emptying and transferring water between the two buckets, you must try to end up with a situation where one of the buckets contains a required volume of water, or where both buckets together contain the required volume. One popular instance of the problem has two buckets with a capacity of 5 and 3 litres respectively, with the goal being to find a solution where one bucket contains exactly 4 litres. One solution is shown below:...