1 / 32

IELM 231: IT for Logistics and Manufacturing

Learn about IT applications in logistics and manufacturing, including human-computer interface design, client-server architecture, web-based auctions, search engines, and more.

hchen
Télécharger la présentation

IELM 231: IT for Logistics and Manufacturing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IELM 231: IT for Logistics and Manufacturing Course Agenda Introduction IT applications design: Human-Computer Interface Fundamental IT tools: sorting, searching The Client-Server architecture, Interacting applications IT in logistics, Case study 1: web-based auctions How auctions work Web issues: session tracking Web issues: secure communications Web issues: cash transactions IT in logistics, Case study 2: web-search Search robots Data processing, Data storage/retrieval (DB, indexes) Data presentation: page ranking techniques

  2. Examples of Sorting Google, Yahoo, … - User inputs search word(s) - Search engine finds many web-pages containing the search word(s) - Search engine determines relative importance rating (IR) for each page - Search engine presents the links to pages, ordered by decreasing IR sort Job scheduling - T-shirt manufacturer must produce 100 different shirt types in next month - Production manager ranks the jobs using some heuristic, e.g. EDD: Earliest due date  do the job with earliest due date first SPT: Do the job with minimum expected time to complete first - Manager sorts the 100 jobs according to heuristic, makes schedule sort

  3. Examples of Searching. Windows - Search for a file of given name in the C: drive - Search for a computer with given IP address in a network search

  4. WanChai NorthPoint Western 5 Central 20 15 10 20 15 15 25 PokFuLam 40 HappyValley 20 40 20 Aberdeen 20 30 20 RepulseBay 50 40 Power Station Lamma Examples of Searching.. Electric Power Supply for Show @ WanChai Lines in graph show maximum available capacity of wires What is the maximum power that can be sent from Power station in Lamma to Wan Chai sub-station ?

  5. Examples of Searching… Graph shows maximum daily capacity (no. of train bogeys) along railway routes What is the maximum daily volume we can transport from Detroit to San Fran?

  6. A simple sorting method: Bubble Sort Input: a list of unsorted numbers Output: the numbers sorted in increasing order Easy extensions: words/names instead of numbers sort in decreasing order Main idea of bubble sort for n number Push the largest to the right (n-th position): - Go from left to right - For each pair, if the two numbers are [larger, smaller], swap them // only (n-1) numbers remain to be sorted (why?) - In the remaining unsorted list, push the largest to the right (repeat this until there are no more swaps).

  7. A simple sorting method: Bubble Sort.. Sort: Bubble sort example The first pass After 4th pass The 2nd pass 5th pass: no swaps  done! After 3rd pass

  8. A simple sorting method: Bubble Sort… Algorithm Bubble sort( input: array A of number) n = number of elements in A repeat flag = false for counter = 1 to n-1 do if A[counter] > A[counter+1] then swap( A[counter], A[counter+1]) set flag = true end if end for n = n-1 until (flag = false) or (n=1)

  9. Improved Bubble Sort: Comb sort Problem with bubble sort: small numbers at the end of list take many steps to move to the front Main idea of comb sort: Initially, instead of comparing neighboring elements (gap = 1), compare numbers at larger distance Slowly reduce the gap of comparison When gap reduces to 1, and no more swaps, sorting is done

  10. Improved Bubble Sort: Comb sort.. Algorithm Combsort( input array A of numbers) gap = A.length repeat //update the gap value for a next comb if gap > 1 gap = gap / 1.3 end if i = 0 flag = false repeat if A[i] > A[i+gap] swap( A[i], A[i+gap]) flag = true end if i = i + 1 until i + gap >= A.length until gap = 1 and flag = false start with large gap, to push small numbers on right side quickly to the left; reduce the gap after each pass one comb (pass)

  11. Searching: definitions. Search: Looking for optimal solutions to discrete problems Terminology: Discrete problem  there are countable (though possibly infinite) feasible solutions Search space  the set of all feasible [partial] solutions There are several variables; for each variable, there are several possible values A solution: assign a value to each of the variables A solution may be: infeasible or feasible A feasible solution may be: optimal or not optimal.

  12. Exhaustive searches: modeling Search: Looking for optimal solutions to discrete problems Exhaustive search: - List all values for one variable ( discrete!) - For the selected value, list all possible values of the next variable - …etc. Common method to model search space: Graph Each node  a decision (e.g. a value of a variable) Each arc  next possible decision after making some choice Common exhaustive search methods: - Depth first - Breadth first - Best first

  13. Search example: the n-Queens problem Place N queens on an NxN chess board such that no Queen attacks any other Example: partial solution of an 8-queens problem (only 3 queens have been placed yet)

  14. Search methods: terminology We will restrict to search over a Graph, G Zero or more node(s) of the graph are the Target, or GOAL Search starts at some node, S Each step, we ‘exploring’ the graph a little more: (i) Select some node we have reached before (ii) Check which other nodes we can directly go from it (Expand it) We maintain two lists: CLOSED = Set of nodes that (i) the search has reached, (ii) are not the GOAL node (ii) explored one step beyond OPEN = Set of nodes that (i) the search has reached, but not yet explored

  15. Depth first search: Last In First Out (LIFO) INPUTS: Graph G, MAX-DEPTH, start node S, GOAL. 1. OPEN = {}, CLOSED = {}; 2. Put S into OPEN, depth( S) = 0; 3. If OPEN is empty, exit (FAIL); 4. Remove topmost node from OPEN and put it into CLOSED; call it node n; 5. If depth( n) = MAX-DEPTH, go to Step 3. 6. Expand n, generating all its successors. For each successor, Snj, Depth (Snj) = depth(n) +1 make a pointer from Snj to n if Snj = GOAL, exit(SUCCESS: report all nodes from Snj to start) insert Snj at the beginning of OPEN; 7. If any successor is a dead-end, remove it from OPEN. 8. Go to step 3

  16. Depth first example The 4 Queens problem: Note: We can place exactly 1 Q in each row Search starts at top row MAX-DEPTH = 4

  17. Summary of Depth First Main idea: Start at S, and put it in set OPEN At each step: Pick FIRST element of OPEN If it is the GOAL: we are done. Else Expand it, Insert all the expanded nodes in the FRONT of OPEN Exercise: Write how a depth first search of your computer’s “My Documents” folder will explore different sub-folders.

  18. Breadth First: First In First Out (FIFO) Main idea: First explore all possible nodes at lower depth, and only then look in the next deeper level. Breadth first search tree for the 4-Queens problem

  19. Depth first vs. Breadth first If the search tree can be very deep, but you expect the GOAL is not too far from the Start node, then use Breadth first Both, LIFO and FIFO are exhaustive search methods  In the worst case, we will need to go around the entire graph to find GOAL Both are simple to implement (in a computer program), but only useful for small or mid-sized problems

  20. Best first: guided search methods Main idea: Use a Heuristic function to identify more promising paths Explore along the more promising path first more likely to lead to GOAL Most popular ‘best first’ method: Branch and Bound search

  21. Branch and Bound search in Scheduling A simple job-scheduling problem: 1 machine, n tasks waiting to be done. Pi= Process time for the i-th task Di= Due date for the i-th task Li= Cost charged per unit time of tardiness for task i. Cost = (Li X t), where t = no of time units of delay Objective: find the task sequence that will minimize the total tardiness cost

  22. Background on task scheduling.. From your production controls class, recall that: In general, for most Real-world scheduling problems, it is not possible to find the optimum solution in reasonable time (even if using a super-computer) [Why ?] Real-world scheduling methods: Production managers usually use some heuristic to schedule jobs Heuristic : a sensible choice, but no guarantee of being optimal Common heuristics: Earliest Due Date (EDD), Shortest Process Time (SPT)

  23. Background on task scheduling.. Real-world scheduling heuristics: Earliest Due Date (EDD), Shortest Process Time (SPT) EDD: Arrange tasks in sequence of earliest due dates SPT: Arrange tasks in sequence of increasing processing time Question: Using EDD or SPT, do we need to search for a solution?

  24. Scheduling using Branch and Bound. An example problem 4 tasks  4! = 24 possible sequences to do the tasks Which is the best? (1) We can list all permutations, calculate Tardiness Cost for each, and select the best one BUT (2) What if we had 50 tasks ? 100 tasks ?

  25. Scheduling using Branch and Bound.. An example problem Best first searching: We need to find, for a partial solution, an estimate of how good/bad it is. For example, suppose we decided to do task 3 first (e.g. guided by SPT) How to estimate whether this is a good choice or not ?

  26. Scheduling using Branch and Bound… An example problem A backward planning approach: Suppose we know that task 2 will be done last, What is the worst case delay cost in that case? Answer: No matter what sequence the other tasks are done, Task 2 will begin at t=(37+1+28) = 66, and finish at t=66+27=93 Therefore Tardiness cost for Task 2 = W = (93-36)*5 = 285

  27. Scheduling using Branch and Bound…. An example problem We can say that W is a lower bound on the total tardiness cost We can compute W for each possible choice of “which task is done last” We select the most promising among these choices, to explore further At each step, we expand the node with minimum W until the optimum schedule is found

  28. Node1 Node2 Node3 Node4 Position 4 task 1 task 2 task 3 task 4 = = = W = 44 W 2 85 W 92 W 280 Node5 Node6 Node7 Node17 Node18 Node19 Position 3 task 2 task 3 task 4 task 4 task 2 task 1 = = = = = = W 144 W 99 W 139 W 367 W 372 W 135 Node11 Node12 Node8 Node9 Node14 Node15 Node20 Node21 Position 2 task 3 task 4 task 2 task 4 task 2 task 3 task 2 task 4 = = = = = = = = W 172 W 144 W 194 W 189 W 139 W 166 W 235 W 230 Node13 Node10 Node16 Position 1 task 3 task 2 task 3 W = 144 W = 189 W = 139 Scheduling using Branch and Bound.…. An example problem

  29. Best first algorithm..…. Algorithm: BranchAndBound_Scheduling OPEN = {} 1. Each task that may be done last is a successor of START. Construct the search tree by adding one node for each such task to START. Add each node to OPEN 2. Calculate lower bound on total penalty, W = Li ( Di - SPj -Pi), for each node found in step 1. SPj is the sum of all tasks that remain to be assigned beyond task i in the tree. 3. Let the node with the lowest W in OPEN be node k; expand k: Each successor of k is a task that is not on the path from START to k. Add pointers from each successor to k; Add each successor of k to OPEN; Calculate W for each successor: Remove k from open and put it in CLOSED; 4. Repeat step 3 until one sequence is completely determined. The cost of this solution is the Current_best. 5. Remove all nodes in OPEN with W  Current_best; (these are dead-ends!) 6. If OPEN is not empty, expand the node with minimum W in OPEN, as in Step 3; Update the current minimum penalty cost if a lower penalty schedule is discovered.

  30. When the search space is too large In the worst case, branch-and-bound will take a very long time to search of the best solution For example, in our scheduling problem the search space increases as n!, which is gets too large very quickly. How to search for solutions when the space is too large to explore? Heuristics: Find some solution, and look for better ones in its “neighborhood” This general idea is used in methods like Genetic Algorithms, Simulated annealing, etc.

  31. Summary What you have learnt: - Some examples where sort and search are useful in IT apps - How to write a simple sort function - How to implement different types of graph searching functions Depth first, Breadth first, and Best first - Decide under what situation you will use which search method

  32. References and Further Reading Books: [For search methods]: Judea Pearl, Heuristics: Intelligent Search Strategies for Computer Problem Solving, Addison Wesley Web sources: [for sorting methods] 1. Wikipedia, Comb sort (wikipedia has very good article on search algorithms also) Next: Communicating applications: The Client-Server Architecture

More Related