Description
[EMERGENCY TRANSMISSION - GALACTIC COMMAND]
Subject: Mission Omega-7 - Navigation through the K-94 Tesseract Anomaly.
Background:
The Omega-7 probe has entered a non-Euclidean hyper-dimensional region known as a Tesseract Grid. The probe’s onboard computer is failing, and you must provide a sequence of movements to reach the "Stability Core" before the probe's energy reserves deplete or it is crushed by a Quantum Anomaly.
1.The 4D Toroidal Spacetime:
The grid is a 4-dimensional hyper-cube of size
. Coordinates are given as
where
. The space is toroidal in all four dimensions: moving from
in any direction with a step of
results in 0.
2.Goal Decoding (The Eigen-Lock):
The coordinates of the Stability Core
are hidden within a 4 x 4 Quantum Matrix M. To decode
:
- Find the four eigenvalues of
.
- Take the absolute value of each eigenvalue.
- Sort these values in ascending order:
- Apply a permutation vector
( where P contains indices 1 to 4) such that
- The final coordinates are
3.Dynamic Quantum Anomalies (4D Cellular Automata):
The grid is infested with anomalies. Let
be a logical 4D array where
means an anomaly exists. The field evolves every second
based on the number of neighbors K(where each cell has
- 1 = 80 neighbors):
- Birth: A cell becomes active if it was dead and has exactly B neighbors.
- Survival: An active cell remains active if it has between
and
neighbors.
- Energy Flux: Each active neighbor of a cellB at time t increases the "Action Cost" of moving into that cell by 0.1
4.Space Warping ( The Wormhole Effect ):
There are two special coordinates,
and
. If the probe enters
at time t, it is instantly transported to
at time
(and vice versa) with a fixed cost of 0.5, regardless of local anomalies.
5.Energy and Action Constraints:
- Max Energy: The probe starts with
.
- Consumption: Each move (including staying still) consumes 1.0 unit of energy. If
, the mission fails.
- Action Cost: The total "Action" to be minimized is the sum of costs:
- Movement: In one second, the probe can move to any of its 80 neighbors or stay in place. However, it cannot enter a cell that is currently "Active"
at time t.
Goal: Find the minimum total Action to reach
steps and before energy runs out.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers6
Suggested Problems
More from this Author20
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Testcases have been updated
A bizarrely complex and poorly explained problem with a trivial set of 5 static test cases, every one of which was simple enough that apart from decoding the goal, I could find and score the least cost path in my head, including the 4-D toroidal space. I don't have great visualization in 4-D, but I can track a vector of 4 integers and a subset of their adjacent coordinates. IIRC, dimension 3 never played a critical role.
More details about the testing:
* 4D Toroidal Spacetime: In every test case, there is a minimal path which does not "wrap" in any dimension. Annoyingly for Matlab, stated coordinates start at zero. I have asked The Math Works for an "array-friendly" version of mod() which never returns a zero or negative value (e.g., modf(0,N) returns N), but so far, no joy. (This is not just for Cody; in my real world problems, I have written several variants of this function to make my higher-level code more clear). I'm pretty sure I wrote something similar in FORTRAN 40 years ago as well. Clear code is maintainable code.
* Goal decoding: This one is just silly, and untested as the permutation matrix is uniformly 1:4.
* Dynamic anomalies: Only used in one test case, and then only for the first second because it's empty afterwards.
* Space Warping: This one's actually used twice! but its action cost is unclear; does it replace the non-warp action cost, or add to it? From the test cases, I see the answer is replacement.
* Energy constraint: never used. Energy used is never more than 5, and energy available is never less than 50.
* Action Cost: nothing new, but poorly explained, even more poorly tested.
* Movement: "Active" cells cut off some optimal paths, but never ALL of the optimal paths. As such, unused.
* T<=100 steps: clearly unused. Every problem is solved by T==5 seconds.
Ignoring the problem and focusing on the test cases, I have developed a solution of size 21, consisting of 240 characters, only a few characters more than the size of the leading solution, which I suspect took some shortcuts.