1 / 14

Knight’s Circuit

Knight’s Circuit. Problem. To find a Knight’s circuit of a chess board. Can we visit every square of a chessboard, once and only once, and return to the starting square. . Systematic Search. We could write a brute force search program (e.g. in Java) 64 squares.

shandi
Download Presentation

Knight’s Circuit

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Knight’s Circuit

  2. Problem • To find a Knight’s circuit of a chess board. • Can we visit every square of a chessboard, once and only once, and return to the starting square.

  3. Systematic Search • We could write a brute force search program (e.g. in Java) • 64 squares. • From each position 2, 4, 6, 8 or 16 moves!!! • Explosion and implosion of choice of moves.

  4. Invent a new problem • Allow any moves • This problem is trivial • Lets consider restrictive moves.

  5. Horizontal and Vertical • Lets consider once square. • Horizontal or vertical. • Call these straight moves. • Can we find a solution. • Do this as an exercise.

  6. 8x8 • Or arbitrary board • EX 8.1 What size boards can we cover with straight moves. • What are the base case and inductive case? • See diagram 8.3

  7. 8.2 Supersquares • Imagine dividing into 2 by 2 squares – 8.6 • Knight moves are either straight or diagonal. • Straight moves are either vertical or horizontal to a Supersquare. • Diagonal moves are not straight.

  8. Crucial observation • Observe vertical moves and horizontal moves. • Vertical moves flip around vertical axis, • Horizontal moves flip around horizontal axis.

  9. Notation • Denote v, the operation of flipping around vertical axis. • Denote h, the operation of flipping around horizontal axis. • ; is used to separate actions. • e.g. v;h means??? • Does v;h = h;v • Both are equivalent to c, rotating thru 180 degrees. • There is a 4th operations n do nothing. • (n = no change) • SO v;v = h;h = c;c = n;n • This allows us to simplify a sequence of actions to one action. • Do e.g. 124 on board • In words…

  10. Exercise 8.6 • Construct a 4 by 4 table showing the single operation of each of the rows and cols

  11. Partitioning the board • Suppose a square is labelled n. Other squares can also be labelled. • All squares are labelled into disjoint sets • Two squares having the same colour, means they can be reached from each other by straight Knight moves. • Two squares of different colour cannot be reached from each other by straight moves. • We can construct straight moves for each of the colours • We have 4 disjoint circuits. These need to be combined into one circuit.

  12. Combining circuits • To combine 4 circuits, combine a pair, then combine another pair. • Combine red and blue • Combine green and yellow • Combine red-blue and green-yellow • 8.12

More Related