This assignment requires you to write a program to find the solution to a logic grid puzzle. A logic grid puzzle is one type of logic puzzles that are set up based on the rules of deduction.

Your task is to write a program that implements an AI technique, either a search or an evolutionary algorithm, which we have covered in the first six weeks of this unit to solve the puzzle as described below. You can write your program in R or Python.

The source code should preferably be in one file. In addition, please submit a “readme” text file describing how to compile your program. A third file that explains any command line arguments that we can use when running your program may be included.

Your program should be terminal based and when runs, should provide all information about the author, what it does, a concise description of the method you have chosen to solve the puzzle, a list of parameters if exist that can be used, etc. When your program is running, we expect intermediate feedback/output on what the program is doing; otherwise, we might think your program has hanged and you might receive no marks for the assignment. The last bit of output from your program should display the answer to the puzzle.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

def run():
    cars = first, _, middle, _, last = range(5)
    orderings = list(permutations(cars))
    result = next(
             toyota_camry: "Toyota Camry",
             hyundai_accent: "Hyundai Accent",
             nissan_x_trail: "Nissan X-Trail",
             holden_barina: "Holden Barina",
             honda_civic: "Honda Civic"
         }[x] for x in (port_macquarie, canadian_couple)]
       for (british_couple, french_lady, chinese_businessman, canadian_couple, indian_man) in orderings
       if indian_man is last
       if just_right_of(indian_man, chinese_businessman)
       for (toyota_camry, hyundai_accent, nissan_x_trail, holden_barina, honda_civic) in orderings
       if toyota_camry is british_couple
       if just_left_of(holden_barina, british_couple)
       for (gold_coast, sydney, newcastle, tamworth, port_macquarie) in orderings
       if sydney is nissan_x_trail...

By purchasing this solution you'll be able to access the following files: and

for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Artificial Intelligence Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats