# Order Practicing Genetic Algorithm Assignment

Order Practicing Genetic Algorithm Assignment
Consider filling a MxN rectangle with the numbers 1…MN in some random order.
For example:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Cost = |1-2| |2-3| |3-4| |5-6| |6-7| |7-8| |9-10| |10-11| |11-12| |1-5| |2-6| |3-7| |4-8| |5-9| |6-10| |7-11| |8-12|
Each number has either 4 neighbors or 3 neighbors (on the edge) or 2 neighbors (in a corner).
The total cost is the sum of the absolute differences between all neighboring pairs of numbers.
If you come up with a fancy alternative to the genetic algorithm, you may request to implement
that as an alternative to solve the same problem.
To construct the initial population of completed states, you can initialize the rectangle however
you want. For example, you might generate completely random initial states, use a specific
ordering of the numbers, or use some other algorithm to create the initial states.
Your program will accept the M and N values on the command line where N follows M, e.g., java
GeneticAlgorithm 2 5, where M=2 and N=5. Your program can output the solution to a test file
(solution_1.txt, solution_2.txt, …), and the total cost both to the standard output (screen) to a text
file (solution_cost.txt). However, it will be given more credits if the ouputs are visualized
graphically on the screen.
Order Practicing Genetic Algorithm Assignment
Please test your genetic algorithm on the problems listed below. You should report:
1. One text file ( solution cost.txt ) should contain the total cost for each of the given
problems. (one line for each)
2. For each of the problems output your solution to a separate file ( solution 1.txt, solution
2.txt, etc. ). Each of the files should contain only your solution (no other text), in other
words it should have N columns and M rows.
Try your genetic algorithm on the following problems. If your algorithm cannot solve or takes too
long to solve a particular problem, please state that in your solution cost.txt file. If your algorithm
takes too long to solve a problem, you may terminate or wait as long as you choose for it to
complete. You are required to solve only problems 1 and 2, but we encourage you to try all of
them. If your algorithm can solve the bigger problems, you will get extra credits.
1. N = 4, M = 5
2. N=7 M = 13
3. N = 37 M = 35
4. N = 75 M = 100
5. N = 490 M = 730
A text file with your solution should contain just the data. In other words, it should have M rows
separated by a new line character ( \n ) and each one of the N columns should be separated by a
comma.
You can use the following programming languages: Java. We will compile (if necessary) and run
your code, therefore, make sure you are not using any non-standard libraries
Your algorithm has to run on Windows 10.
Submission Instructions
Submit all of your code and a report. In a report, describe what algorithm you have implemented
and how to run your code. The report is required to be in a pdf format.
the outputs of the codes are, and how those outputs were produced in that video. After
not include the link, you will lose 40 points)
Zip all of your code and report and text files in a zip file titled .zip (e.g.

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.