My programming homework requires me to determine from a given set of dominoes if we can chain them in a way that all dominoes have equal number of dots on the touching sides. The two ends don't have to have matching sides.
Same task as this, except the matching ends part: https://exercism.org/tracks/elixir/exercises/dominoes
I tried to find a solution using graphs, but no luck (couldn't find a solution to determine Hamiltonian connectedness). My other idea would be to use Backtrack Search, but that doesn't seem very elegant.