690 likes | 714 Views
Explore the application of the Nearest-Neighbor Algorithm for solving the Traveling Salesman Problem to find efficient routes with minimal cost. Understand the benefits and limitations of this method compared to brute-force solutions. Dive into practical examples to enhance comprehension and application of the algorithm.
E N D
Activity 1: Traveling salesman problem • Sandy’s grandmother lives in an old one-story house. There are many connecting doors between the rooms. One day, Sandy wanted to find a route that would take her though each door exactly once. Help Sandy find a route.
Tsp Solution • If a room has an odd number of doors, you must either begin in that room or end in that room
This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
Expand the circuit • Steve just added a visit to Columbus, Ohio. This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
The Nearest-neighbor Algorithm • Choose a node as your starting point • From the starting node, travel to the node for which the fare is the cheapest. We call this node the “nearest neighbor”. If there is a tie, choose one arbitrarily. • Repeat the process, one node at a time, traveling to nodes that have not yet been visited. Continue this process until all nodes have been visited. • Complete the Hamiltonian circuit by returning to the starting point. • Calculate the cost of the circuit. This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
The Nearest-neighbor Algorithm What is the cost of the route? What is the new route? $531.00; WPCoCSAW This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
The Nearest-neighbor Algorithm • Why does using the nearest-neighbor algorithm make more sense than using the brute-force method in this case? • Will the nearest-neighbor algorithm always give a good route? Why or why not? This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
Repetitive Nearest-neighbor Algorithm • Select any node as a starting point. Apply the nearest-neighbor algorithm from that node. • Calculate the cost of that circuit. • Repeat the process using each of the other nodes as the starting point. • Choose the “best” Hamiltonian circuit. This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
Repetitive Nearest-neighbor : Solution • 1. Start at P: PWACSCoP = 74+76+104+65+110+79= $508 • 2. WACSCoPW; its cost is the same, $508. A circuit goes into and out of each city. Therefore, the starting point within a given circuit has not effect on the total cost. • 3. Start at C: CSWPCoAC = 65+105+74+79+121+104 =$548 • 4. Start at A: AWPCoCSA = 76+74+79+88+65+149 = $531 • 5. Start at S: SCCoPWAS = 65+88+79+74+76+149 = $531 • 6. Start at Co: CoPWACSCo = 79+74+76+104+65+110 = $508. This is identical to the circuit found by starting the nearest –neighbor algorithm at Pittsburgh. The cheapest circuit found by starting the algorithm at either Pittsburgh or Columbus translates to WACSCoPW and costs $508. This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
Activity #2 • Instructions: • Using the poster board and the pins, place the different characteristics under the correct method This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
solution This opportunity if funded by the United States Department of Education. Award # 2010-38422-19963 - DAY 6 : 6/25/2012
Linear Programming This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Algebra • Variable “x” or “y” • It can also be “x1” and “x2” This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Linear Equation • x+2y=16 x=0 y=8 x=2 y=7 x=6 y=5 x=14 y=1 x=16 y=0 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Series of linear equations • x+2y=16 • x+ y=12 x+2y-2y=16-2y x=16-2y (16-2y)+y=12 16-2y+y=12 16-y=12 16-y+y=12+y This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Series of linear equations • x+2y=16 • x+ y=12 16=12+y x+2(4)=16 16-12=16+y-12 x+8=16 4=y x+8-8=16-8 x=8 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Series of linear equations • x+2y=16 • x + y=12 • x=8 • y=4 (8)+2(4)=16 (8)+ (4)=12 8+8=16 12=12 16=16 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Inequality • x + y<12 x=0 y=0 x=0 y=1 x=1 y=0 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Graph Linear equation • y-2x=1 x=0 y=1 x=1 y=3 x=2 y=5 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Graph inequality • y<x y=1 x=0,-1,-2,-3….. y=0 x=-1,-2,-3,-4….. y=5 x=4,3,2,1….. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Linear Programming • For many manufactures the ability to maximize profits is limited, or constrained by their machine, production line, and assembly line capacity, as well as by the size of their workforce. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Linear Programming • Linear programming assists managers in making complex product-mix decisions in the presence of constraints. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Linear Programming • The founder of linear programming was American operations researcher George Dantzing. • The first problem solved was a minimum-cost diet problem that involved the solution of 9 equations with 77 decision variables. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Linear Programming • Dantzing, working with The National Bureau of Standards, supervised the solution of the diet problem, which took 120 person-days using hand-operated desk calculators. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
McDonald's Franchises This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
McDonald's Franchises This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
McDonald's Franchises This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
McDonald's Franchises This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • The High Step Shoe Corporation wants to maximize its profits. • Airheads=$10 • Groundeds=$8.50 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • In developing a production plan, managers will often be constrained by limited resources such as number of workers, availability of raw materials, maximum demand for a product , and so forth • Quantities that can change (vary) and that managers are able to control are called decision variables. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Decision Variable • What are the decision variables that the managers at High Step Sports Shoe must consider? The main decision variable to consider are the number of Airheads (A) and Groundeds (G) to produce each week This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Objective Function • The goal is to make the most money, or to maximize profits. P=10A + 8.5G This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Constraints • The steps in manufacturing the shoes include cutting the materials on a machine and having workers assemble the pieces into a pair of shoes. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Constraints • There are 6 machines that are used to cut materials. • Each pair of Airheads requires 3 minutes of cutting time, while each pair of Groundeds requires 2 minutes. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Constraints • There are 850 workers who assemble the shoes. • It takes a single worker 7 hours to assemble a pair of Airheads and 8 hours to assemble a pair of Groundeds. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Constraints • The assembly plan operates 40-hours per 5-day work week. • Also, each cutting machine is operated only 50 minutes per hour to allow for routine maintenance. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • How many minutes of work can 6 machines do in 40-hour work week? • Now use the decision variables to write an inequality to represent a constraint that is based on the limited time the cutting machines operate each week. 6 X 50 X 40 = 12000 minutes 3A + 2G < 12000 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • How many hours of work can 850 assembly workers do in a week? • Write an inequality to model a constraint based upon the limited number of worker hours available for shoe assembly each week. 850 X 40 = 34000 hours 7A + 8G < 34000 This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • Could the number of pairs of shoes of each style that are produced each week ever be negative? Could it be zero? Why or why not? • Then, are there more constraints? Which? This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • Graphing the system of inequalities shows the feasible region of the graph. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • What does each pair of coordinates represent? • Which of the six intersection points satisfy all the constraints? • What does the shaded region of the graph represent? This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • Of all the feasible points, one will give the maximum profit. The process of determining this best solution is called optimization, and the solution itself is called optimal solution. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • How many feasible points are there? Pick three points in the interior of the feasible region. List the corresponding values of A and G in a table like this one, and evaluate the profit P for each point selected. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • Compare your answers with those of other students, and see which point has the most profit. Now test each feasible corner point. Enter these values of A, G, and P in another table This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • Which point from either table yields the largest profit? • What do the coordinates of this point represent? This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
High Step Sports Shoe • This problem is an example of the corner principle. This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Activity #3: Lego Furniture • Model production in a furniture facture • Suppose a company produces only tables and chairs • A table is made of 2 large and 2 small pieces • A chair is made of 1 large and 2 small pieces • Profit: Table - $16 ; Chair - $10 • Determine product mix that maximizes the company’s profits using the available resources This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
Activity #3: Solution This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
The Meat Industry in New Zealand This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012
The Meat Industry in New Zealand This opportunity if fundedby the United States Department of Education. Award # 2010-38422-19963 - DAY 7 : 6/26/2012