Ijee / Amazeing

This project aims to visualize various algorithms to create or traverse mazes.
https://amazeing.app/
MIT License
44 stars 5 forks source link

[Bug]: Trémaux’ algorithm passage marks are not correct under certain conditions #2

Open Ijee opened 3 months ago

Ijee commented 3 months ago

What happened?

When creating mazes with most algorithms, there is currently a problem with how the algorithm marks entrances/exits for passages that are within 2 nodes of each other (see screenshot). The markings are currently tracked as a node weight, which is incorrect.

Using the node.text property is also not ideal, as it makes the information unreadable on most screen sizes (e.g., formatting like "1 / 2") and it would also not be clear which number is belongs to which passage.

There likely needs to be an option to show custom symbols, as demonstrated in this GIF: https://de.wikipedia.org/wiki/Tr%C3%A9maux%E2%80%99_Methode#/media/Datei:Tremaux'_Methode_-_animiertes_Beispiel-schnell.gif

Using the node-status property is one possibility, but I do not really like it because it is not intended for this use case, really. We likely need a new property specifically for such things which the node component will then handle.

Reproduction steps

  1. Create a maze that has lots of passages close to each other
  2. Run the Trémaux' algorithm
  3. You will see passage entrances that have been marked more than 2 times that should not have been possible

Version

1.2.2

What browser did you use?

Chrome, Firefox

Screenshots (optional)

image

Console Logs (optional)

No response