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 8113231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:45:47+00:00 2026-06-06T02:45:47+00:00

I have a 6*6 puzzle with 35 numbers(1~35) in a random sequence. Use the

  • 0

I have a 6*6 puzzle with 35 numbers(1~35) in a random sequence. Use the blank one as a ‘register’ and move the numbers one by one to let them be in order. I can deal with a 3*3 puzzle, but how to deal with a 6*6 one? Could you give me some hints?
enter image description here

  • 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-06-06T02:45:48+00:00Added an answer on June 6, 2026 at 2:45 am

    The idea is the same, represent the problem as a states graph, and run shortest path algorithm.

    If the efficiency of the algorithm is important, you might want an informed algorithm -such as A* algorithm, which is expected to be pretty fast (relative to the alternatives) with a good admissible heuristic function.

    A slower though simpler solution can be running a BFS.

    Both algorithms (A*, BFS) are both complete (always finds a solutuion, if one exists) and optimal (finds shortest path).

    Also note, you can use macros to learn “good” series of moves, to get the algorithm faster. Ignore this improvement until you implement a working (though slow) solution.


    EDIT: Coding guidelines:

    Look at the problem as a graph: The graph will be G=(V,E) where V = { all possible states} and E = { (u,v) | can move from state u to state v within a single step }

    Now, with this graph – you have a starting position (the source, which is given as input) and a target (a sorted puzzle). Start a BFS or A* (have a look at the pseudo code of these in the attached wikipedia links), to find a path from the source to the destination. You should start with BFS – it is simpler.

    The path returned by the shortest path algorithm is identical to the series of moves you will have to do in order to get from the starting board to the target.

    Note: You do not need to create the actual graph! you just need a to hold the starting node (source) – and create its vertex, and have a successors:V->2^V function, that gives you the successors for each vertex (formally: successors(v) = { (v,u) | (v,u) is in E } ). This way, you can build the relevant part of the graph on the fly.

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

Sidebar

Related Questions

I am doing a puzzle where I have to deal with numbers of order
I've looked around and have bits and pieces but can't put the puzzle together.
all of you have probably seen the moving number/picture puzzle. The one where you
I have a simple jigsaw puzzle i'm making. I have a method that is
I have a simple puzzle game. There is an image consisting of 16 tiles
I have a problem with creating a sliding puzzle. I'm trying to make a
This is Interviewstreet puzzle: We have a country containing N cities. Each day we
So i have this program that should solve a futoshiki puzzle in C wich
I have encountered this interview puzzle and want to know its accurate answer. You
I have implemented the First-Fit-Decreasing bin packing algorithm to split a list of numbers

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.