Jump to content
  • Advertisement
Sign in to follow this  
Murloc992

Filling a grid using Hamiltonian paths

This topic is 1147 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!