2
$\begingroup$

For Christmas my brother got me this puzzle: puzzle

The premise is that you have a metal medallion with a series of holes in it and a metal ring with a slit just large enough to slide it from hole to hole, barring obstacles, like the edge of the map and an obstruction near the top. The goal is to be able to remove the ring from the medallion when starting at the center hole. It was simple enough to figure out after mapping out taken paths, but after solving it, I thought it might be fun to make a solver: solver

I'm sure something like this has been done and is part of some Legend of Zelda-like dungeon, but I wanted a simple example to demonstrate some concepts in Angular. The Angular part took about 15-30 minutes to throw together after a longer time of working out the nodes and edges.

The Problem

My first thought was that is represented an undirected graph, so I labeled each of the 24 holes with letters A-X and recorded all of the edges as holes that the ring can travel directly between. That works, except for the obstacle (an intentionally raised point) that exists between A, B, C, and D.

Start

End

In this exact puzzle, the solution is: Start,M,A,I,F,U,H,K,R,D,Q,V,J,X,P,N,B,Q,End

Applying a simple shortest path algorithm renders: Start,M,A,I,F,U,H,K,R,D,Q,End

The problem with that solution is that the exit is not reachable from Q until you have gotten on the other side of the raised point at the top, so you have to run through the little cycle of Q,V,J,X,P,N,B,Q to get around it.

I'm getting the vibe that the correct structure may not be an undirected graph or that I need to use something other than the shortest path, but I'm not sure what the terms I need to look for are going to be.

Extra Info

All of the existing edges I've found are: [["A","M"],["A","I"],["B","N"],["B","Q"],["B","P"],["C","K"],["D","R"],["D","S"],["D","Q"],["E","R"],["E","K"],["F","I"],["F","U"],["G","W"],["H","U"],["H","K"],["H","O"],["H","W"],["I","L"],["J","X"],["J","V"],["K","R"],["M","Start"],["N","P"],["P","X"],["Q","End"],["Q","V"],["T","V"]]

I was going to look into some way to plot the nodes in Angular in a way that correlated to their relative positions on the medallion, but the main problem seemed more important.

Imgur Album

$\endgroup$
2
  • 1
    $\begingroup$ Could you edit to clarify what your actual question is? From skim-reading your post, I can't tell what it is that you want us to do for you. $\endgroup$ Commented Dec 27, 2017 at 18:25
  • $\begingroup$ There are nodes where you can only travel between them after having traveled through an adjacent cycle due to the obstacle. I am looking for thoughts on a better way to approach the existence of the obstacle $\endgroup$
    – Sethionic
    Commented Dec 29, 2017 at 23:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.