Back Tracking Project - PowerPoint PPT Presentation

About This Presentation
Title:

Back Tracking Project

Description:

A classic puzzle for chess buffs is the N-Queens problem. ... This requires that no two queens are in the same row, or the same column, or ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 5
Provided by: thaddeusf
Category:

less

Transcript and Presenter's Notes

Title: Back Tracking Project


1
Back Tracking Project
  • Due August 11, 1999
  • N-queens
  • A classic puzzle for chess buffs is the N-Queens
    problem. Simply stated is it possible to place n
    queens on an empty nxn chess board so that no
    quen is attacking any other. This requires that
    no two queens are in the same row, or the same
    column, or along the same diagonal.

2
N-queens
  • Example for n 8 consider the following solution

3
Program description
  • Write a JAVA program which solves the n-queens
    problem using recursive backtracking. The user
    should enter the number n, which specifies the
    board size and the number of queens. Your program
    should output the solution if one exists, or a
    message saying indicating that no solution could
    be found (look at n2).

4
Analysis
  • Your program should give a measure of the run
    time required for a given solution (counting the
    number of calls to the recursive method).
  • In your README file, plot the run time measure of
    your algorithm for various values of n and
    compare these values to a theoretical time based
    on analysis of your code.
Write a Comment
User Comments (0)
About PowerShow.com