Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 407273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:34:42+00:00 2026-05-12T17:34:42+00:00

Okay this is a homework question, and I just don’t have a clue how

  • 0

Okay this is a homework question, and I just don’t have a clue how I suppose to start. Some help and hints will be much appreciated.

I need to use a heuristic function to solve a maze type problem.

Suppose I have a 5×5 grid, and a robot in position (1,5) and my goal is to move the robot to (5,1). Along the way there are few obstacles, say (X,1,3), (X,2,3), (X,5,3), (X,4,2)

Print out the route the robot has gone through.

I’m thinking using the greedy best first search algorithm to find a path for robot to the goal

My problem is, I’m new to scheme have no idea how I should start on solving this kinda problem.

Should I ?

(define grid l w) --define the length and width of the grid ? 

(define robot) --define the initial position

(define goal) --define the goal position 

(define blocks) --define the obstacle blocks

and create a main function (define bestfirstslove)

to solve the problem ?

How can I create a grid ? How should I approach to this problem ? How can I print out the steps the robot travels ?

Help is much appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:34:43+00:00Added an answer on May 12, 2026 at 5:34 pm

    Ok, so the first thing you do is discretize your search space. Using your example of a 5×5 grid, this means you have a total of 25 points your robot can occupy.

    Then, you select your search algorithm. You’ve chosen Greedy Best First Search (GBFS), so let’s go with that, but in a real situation you should choose it as per your problem requirements.

    GBFS is a simple algorithm and requires the following ( and you’ll need most of these modules for any path finding algorithm):

    1. A function to list all the neighbors of any node. E.g. in the grid we’ve specified above, the neighbors are trivially determined (+1,-1 permutations in both directions with some boundary checking and of course, check if it’s an obstacle).

    2. A data structure to keep track of Open nodes: Open nodes are nodes which are yet to be examined. So in the example code in Wikipedia, you start with the initial position, find its successors (using the above function) and based on a heuristic (you can use the Euclidean or Manhattan distance between the goal and the successor as a heuristic) you add it to the Open “list” – which is better implemented as a priority queue.

    3. Your main function: This will essentially start with the initial position (1,5) and find its neighbors and add them to the priority queue based on the Euclidean distance to the goal. Then recurse (i.e. do the same thing as what you did with the initial position) on that list until you find your goal.

    So, what you should note about Greedy Best First is you may not have the optimal path, but you’re guaranteed termination and a path (if one exists). You should think about other algorithms like A* or Breadth First or Depth First and see what works for your requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this question is very simple: I have a facebook page, and a website.
Okay this may be a simple question but I have yet to come with
Okay - yes, this is homework, but it isn't mine. I have a friend
Okay so I made this program to help me out with my homework and
Okay this is probably a rookie question, but I have never done GUI programming
Okay this seems like a real noob question. I currently have a simple html
Okay this is a revised question from earlier today, I have included code to
Okay so this doesn't really have much to do with code help but I
Okay this is definitely a n00b question but here goes. The way I understand
Okay this is definitley an easy question and a stupid one but since I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.