Using python implement a genetic algorithm for the Traveling Salesman Problem for the following distance matrix...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Using python implement a genetic algorithm for the Traveling Salesman Problem for the following distance matrix without using external software packages. The program should create an output file containing the best tour generated during each generation. Please provide: • The input data file with the below distance matrix . • The source code of program . • The output file Create data Matrix using below: Bakersfield 129 Barstow 206 153 Carlsbad 569 696 777 Eureka 107 236 315 462 Fresno 360 395 780 398 388 Lake Tahoe, So. 284 155 312 797 408 466 Las Vegas 314 Long Beach 364 335 118 153 Monterey 432 403 126 88 111 Oakland 112 111 388 426 144 139 82 713 251 479 115 130 93 694 222 456 302 162 291 370 407 55 194 446 200 329 406 369 93 156 484 231 360 428 388 152 266 504 288 417 496 291 181 195 567 226 123 116 795 333 435 276 436 565 644 150 329 249 640 580 551 274 236 272 401 480 314 185 107 587 416 387 110 72 185 87 498 174 71 827 43 281 436 228 68 59 336 374 394 462 52 231 176 23 800 338 542 332 105 116 393 431 451 519 139 297 426 505 272 190 192 568 441 412 135 97 116 9 523 252 381 460 317 145 197 524 396 367 114 82 71 40 478 118 247 293 504 137 197 414 229 200 192 230 135 227 311 492 354 240 332 206 45 72 484 166 59 573 234 263 347 146 225 188 609 242 124 95 297 335 258 387 466 349 151 229 524 402 373 118 114 140 75 453 199 207 426 347 476 565 222 240 121 250 329 544 82 227 356 435 356 120 200 329 408 488 93 133 199 610 335 408 131 510 435 29 Los Angeles 306 277 Merced 344 315 37 Modesto 491 462 265 236 371 342 344 315 185 147 137 175 65 27 119 81 446 514 Palm Springs 325 214 682 Redding 164 Sacramento 610 446 San Bernardino 667 503 105 San Diego 223 87 471 528 San Francisco 254 114 426 483 411 301 259 316 546 406 254 211 286 146 432 489 251 103 411 247 209 45 191 45 San Jose 232 187 337 292 77 32 521 578 50 95 295 352 272 227 401 458 84 69 355 374 431 216 195 San Luis Obispo 105 Santa Barbara 180 285 San Cruz 282 387 127 Santa Rosa 174 287 233 256 361 101 230 335 199 322 Sequoia Park 134 202 Stockton 266 175 146 Yosemite Using python implement a genetic algorithm for the Traveling Salesman Problem for the following distance matrix without using external software packages. The program should create an output file containing the best tour generated during each generation. Please provide: • The input data file with the below distance matrix . • The source code of program . • The output file Create data Matrix using below: Bakersfield 129 Barstow 206 153 Carlsbad 569 696 777 Eureka 107 236 315 462 Fresno 360 395 780 398 388 Lake Tahoe, So. 284 155 312 797 408 466 Las Vegas 314 Long Beach 364 335 118 153 Monterey 432 403 126 88 111 Oakland 112 111 388 426 144 139 82 713 251 479 115 130 93 694 222 456 302 162 291 370 407 55 194 446 200 329 406 369 93 156 484 231 360 428 388 152 266 504 288 417 496 291 181 195 567 226 123 116 795 333 435 276 436 565 644 150 329 249 640 580 551 274 236 272 401 480 314 185 107 587 416 387 110 72 185 87 498 174 71 827 43 281 436 228 68 59 336 374 394 462 52 231 176 23 800 338 542 332 105 116 393 431 451 519 139 297 426 505 272 190 192 568 441 412 135 97 116 9 523 252 381 460 317 145 197 524 396 367 114 82 71 40 478 118 247 293 504 137 197 414 229 200 192 230 135 227 311 492 354 240 332 206 45 72 484 166 59 573 234 263 347 146 225 188 609 242 124 95 297 335 258 387 466 349 151 229 524 402 373 118 114 140 75 453 199 207 426 347 476 565 222 240 121 250 329 544 82 227 356 435 356 120 200 329 408 488 93 133 199 610 335 408 131 510 435 29 Los Angeles 306 277 Merced 344 315 37 Modesto 491 462 265 236 371 342 344 315 185 147 137 175 65 27 119 81 446 514 Palm Springs 325 214 682 Redding 164 Sacramento 610 446 San Bernardino 667 503 105 San Diego 223 87 471 528 San Francisco 254 114 426 483 411 301 259 316 546 406 254 211 286 146 432 489 251 103 411 247 209 45 191 45 San Jose 232 187 337 292 77 32 521 578 50 95 295 352 272 227 401 458 84 69 355 374 431 216 195 San Luis Obispo 105 Santa Barbara 180 285 San Cruz 282 387 127 Santa Rosa 174 287 233 256 361 101 230 335 199 322 Sequoia Park 134 202 Stockton 266 175 146 Yosemite
Expert Answer:
Answer rating: 100% (QA)
Solution Input Data File Distance Matrix A B C D E F A 0 5 3 7 9 5 B 5 0 8 6 4 7 C 3 8 0 2 10 9 D 7 6 2 0 8 3 E 9 4 10 8 0 5 F 5 7 9 3 5 0 Source Code of Program import numpy as np Initialize distance ... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
On January 1, 2XX2, a parent purchases all of the stock of its subsidiary for $20,000. The subsidiary reports Stockholders' Equity of $16,000 on the date of purchase. The parent assigns the $4,000...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
THIRD AVENUE SOFTWARE HEALTH-CARE APP PROJECT This case is new for the ninth edition of Information Technology Project Management . The case provides an opportunity to apply agile and Scrum...
-
You are performing the audit for Premium Pet Care Pty Ltd (PP), which operates a luxury boarding kennel and daycare facility for dogs and cats. PP bill their customers after their pet's stay, with...
-
How would you prepare the following compounds from 2-phenylethanol? More than one step may be required. (a) Styrene (PhCH = CH2 (b) Phenyl acetaldehyde (PhCH2CHO) (c) Phenyl acetic acid (PhCH2CO2H)...
-
Show that z is a null vector for the quadratic form q (x) = xT Kx based on the Gram matrix K = ATA if and only if z ker K.
-
In the endless endeavor to make electronic devices as small as possible, you have been hired to make a capacitor that has the greatest capacitance possible in a cubic volume of \((10 \mathrm{~mm})...
-
You have been engaged by Markus Industries to examine its projected financial statements for 2011. Required: For each of the following, state the evidence sources and procedures you would use to...
-
1. Let p and q be two positive numbers such that p + q = 2 and p + q = 272. Then p and q are roots of the equation: (a) x-2x+8=0 2. lim x 0 (sint)dt (b) x-2x+136=0 (c) x-2x+16=0 (d) x-2x+2=0 0
-
The owner of Neros company has hired you to analyze her company's performance and financial position, as well as the positions of Iits competitors, Centar and Xermix. However, the data Neros abtained...
-
The most difficult CAPM input to estimate is the (A) market beta of the project (B) risk-free interest rate (C) equity premium (D) standard deviation
-
What is management audit?
-
What is periodical audit? What are the advantages and disadvantages of periodical audit? Distinguish between continuous audit and periodical audit.
-
(a) Distinguish between internal audit and statutory audit. (b) Can the statutory auditor rely upon the internal audit in carrying out his function as a statutory auditor?
-
Explain the following statement (a) Vouching is the essence of auditing. (b) In vouching payments, the auditor does not merely seek proof that money has been paid away.
-
What precautions are to be taken in the application of internal check system?
-
The integers with absolute value less than 1,000,000. (Check all that apply.) Check All That Apply The set is countably infinite. The set is finite. The set is countably infinite with one-to-one...
-
A. Select a recent issue (paper or online) of Report on Business Magazine, Canadian Business Magazine (online only), Bloomberg Businessweek, Fast Company, The Economist, or another business magazine....
-
WhiteFlowers4You sells flower arrangements over the Inter-net. Recently the company has been experimenting with accepting digital cash. At first, the introduction of digital cash brought an immediate...
-
Identify several points where reconciliation of control totals should occur in the batch processing of transactions against a master file.
-
Match the following list of items to the letters A through F in Figure. 1. Create Order. 2. Master Price List. 3. Customer Order. 4. Order Database. 5. Sales Order. 6. EnterOrder. Order Entry
-
Suppose that a speculative-grade bond issuer announces, just before bond markets open, that it will default on an upcoming interest payment. In the announcement, the issuer confirms various reports...
-
The expected effect on market efficiency of opening a securities market to trading by foreigners would be to: A. Decrease market efficiency. B. Leave market efficiency unchanged. C. Increase market...
-
1. An analyst estimates that a securitys intrinsic value is lower than its market value. The security appears to be: A. Undervalued. B. Fairly valued. C. Overvalued. 2. A market in which assets...
Study smarter with the SolutionInn App