Newsgroups: comp.ai.edu
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.mathworks.com!news.kei.com!wang!news
From: s2722160@techst02.technion.ac.il (Udi Atar)
Subject: HELP: 6-Tubes puzzle
Organization: Technion, Israel Institute of Technology
Date: Mon, 12 Jun 1995 10:28:53 GMT
Message-ID: <DA22G5.GD3@discus.technion.ac.il>
Keywords: heuristic, ai, puzzle
Sender: news@wang.com
Lines: 121

I need help!!!
I need to solve the tubes-puzzle (game description at end of massage) 
  using the A* search. To do that I need a good heuristic function.
This function should receive the current state and the goal state and 
  estimate the number of moves needed to get to the goal state.
Any ideas to such a function are most welcome.

       Please e-mail to 
              s2722160@techst02.technion.ac.il

        Thanx in advance
              Udi.

 ************************************************************************
 *   \ o /  _ o        __|    \ /     |__        o _  \ o /   o -eeha!  *
 *     |     /\   __\o   \o    |    o/    o/__   /\     |    /|\        *
 *    / \   | \  /) |    ( \  /o\  / )    |  (\  / |   / \   / \        *
 ************************************************************************

---------------------------------CUT HERE----------------------------------

			 6-TUBES Puzzle.
			 ~~~~~~~~~~~~~~~


   Below is a description of a game puzzle. 

   Puzzle Description:
   ==================

Topology: 
--------
  The game consists of two sets of tubes, each having 6 tubes arranged
  in a circle. The tubes in each circle are of sizes 1,2,3,4,5 and 6,
  and are arranged from small to large. The two sets are combined
  together in such a way that one set can be rotated relatively to the
  other.
  For example, starting from a state where both sets are one above the
  other and rotating twice.

              #                      #                      #
            # #                    # #                    # #
          # # #                  # # #                  # # #
        # # # #                # # # #                # # # #
      # # # # #              # # # # #                # # # #   #
    # # # # # #    ROTATE    # # # # # #    ROTATE    # # # # # #
    -----------   ========>  -----------   ========>  -----------
    $ $ $ $ $ $              $ $ $ $ $ $              $ $ $ $ $ $
      $ $ $ $ $                $ $ $ $ $                $ $ $ $ $
        $ $ $ $                  $ $ $ $                  $ $ $ $
          $ $ $                    $ $ $                    $ $ $
            $ $                      $ $                      $ $
              $                        $                        $

Goal:
----
  The tubes contain 21 beads of the following colors:
  one black bead (b), two white ones (w), three blue (u), four yellow
  (y), five green ones (g), and 6 red beads (r). The goal of the game
  is to sort the beads according to their colors, so that they are all
  located in one of the two sets, and each tube in the set contains
  only beads of the same color.
  For example, the final state, if the "$" set contains the beads,
  is:

              #
            # #
          # # #
        # # # #
      # # # # #
    # # # # # #
    -----------
    b w u y g r
      w u y g r
        u y g r
          y g r
            g r
              r


Operators:
---------
  In order to reach such a final state from an arbitrary initial
  state, three operators are allowed:
  1) FLIP:
     The two sets are flipped so that the set that was below becomes
     the one on top, and the one that was above becomes the lower set.
     As a result of this operation the beads fall from the tubes of
     the newly top set into the matching tubes of the newly bottom
     set.
  2) R-ROTATE:
     The two sets are relatively rotated once to the right. As a
     result of this operation, beads from the upper set tubes might
     fall into tubes of the lower set.
  3) L-ROTATE:
     Same as R-ROTATE but to the other direction.

  For example, starting from an arbitrary state and performing:
  R-ROTATE, FLIP:

              #                      #                          $
            # #                    # #                        $ $
          # # #                  # # #                      $ $ r
        # # # #                # # # #                    $ $ $ r
      # g # # #              # # # # #                  $ $ $ $ r   
    # # y # g #    ROTATE    # # # g # #     FLIP     $ $ $ $ $ r
    -----------   ========>  -----------   ========>  -----------
    b $ u g g $              b g u g g $              # # # y # r
      $ w r y r                y w r y r              b y w y g
        w y u r                  w y u r                g w r u
          y u r                    y u r                  u g u
            g r                      g r                    g y
              r                        r                      g



----- End Included Message -----




