Jump to content
  • Advertisement
Sign in to follow this  
Murloc992

Filling a grid using Hamiltonian paths

This topic is 1065 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,
 
recently I was trying to implement a Hamilton path function to generate/fill a grid of points with a snake-like path.
 
Generally the code I have now miss-performs in the beginning and near the last steps, between those (80% of the generation) everything seems extremely fine. I really cannot find what would be the issue. Seems like my nodes just snap and another, related node gets placed in a completely random spot. Maybe somebody could point out where I did a mistake?
 
Here is my Pastebin code:
 
 
I am using GLM for vec2 class, but a simple struct with int x and y would do. 
 
Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!