Thread: need some help on this problem - a few hints please

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    15

    Question need some help on this problem - a few hints please

    i was given d this prob. as a proj.Pls give some hint how to get about it : -
    there is a 3D maze(n*n*n;n is odd).there are some hindrances(1)to be avoided. the starting position is to be chosen and d objective is to reach the centre of the maze. if it is not possible to reach then print "NO" else print "YES" and find the shortest path.
    eg.
    ----------------
    1 0(start) 0
    0 1 0
    1 1 1
    --------------------
    1 0 1
    1 0(destn) 0
    0 1 0
    --------------------
    0 0 0
    1 1 0
    1 0 0
    --------------------
    output: Yes,3

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Make a google search for the A* (A-star) algorithm. It can find the optimal path through a labyrinth assuming one exists.

    As a sidenote, I implemented A* in a program. It can be found here:
    http://momm.seiken.co.uk/forum/index.php?showtopic=1883

    That program uses a 2D maze, but I don't think it's hard to extend to 3D.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM