1 / 23

Critical Path Analysis & List Processing Algorithm

Critical Path Analysis & List Processing Algorithm. Scheduling Tasks. A processor is a person, machine, computer, or robot etc., which works on a task. To solve a scheduling problem typically the tasks are scheduled to minimize completion times.

elias
Download Presentation

Critical Path Analysis & List Processing Algorithm

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. Critical Path Analysis&List Processing Algorithm

  2. Scheduling Tasks • A processor is a person, machine, computer, or robot etc., which works on a task. • To solve a scheduling problem typically the tasks are scheduled to minimize completion times. • Make sure to consider importance of a task, does one task need to be completed before another task.

  3. ASSUMPTIONS AND RULES • If a processor starts working on a task, the work will continue until that task is complete. • No processor stays idle if there is a task to be done. • The CPA has an associated order-requirement digraph. • The tasks are arranged in a priority list that is independent of the digraph.

  4. Goals of CPA • Minimize the completion time for a given number of processors • Minimize processor idle time • Minimize the number of processors needed to complete the job in a specified time. A task is considered ready if all its predecessors (prerequisite tasks) in the digraph have been completed.

  5. LIST PROCESSING ALGORITHM • Assignment of Processors: The lowest numbered idle processor is assigned to the highest priority ready task until either all processors are assigned or all ready tasks are being worked on • Status Check: When a processor completes a task, that processor becomes idle. Check for ready tasks and tasks not yet completed and determine which of the following applies • If there is a ready task repeat step 1. • If there are no ready tasks bunt not every task has been completed, the idle processor remains idle until more tasks are completed. • If all tasks are completed, the job is done.

  6. EXAMPLE: • What is the completion time for the job shown in the digraph below using the priority list using one processor

  7. T1-10 T4-22 T3-7 T2-18 T5-29 P1

  8. EXAMPLE: • What is the completion time for the job shown in the digraph below using the priority list using two processors?

  9. T2-15 T3-7 T5-22 P1 P2 IDLE-7 T1-3 T4-11 IDLE-15 IDLE-22

  10. Making Fajitas • Tortillas • Chicken • 1 onion • Seasoning • Tomatoes • Cilantro T1: slice chicken & onions – 5 min T2: Cook chicken – 10 min T3: Cook onions – 5 min T4: Add seasoning – 1 min T5: Chop tomato – 4 min T6: Mix tomato and cilantro – 2 min T7: Warm tortillas – 1 min T8: Serve – 1 min Priority list: ,,

  11. , , T7-28 T2-21 T3-26 T5-4 T6-6 T1-11 P1 T4-27 T8-29

  12. , , T8-22 T4-21 T7-7 IDLE P1 T3-20 T5-4 T6-6 P2 IDLE T2-15 T1-5 IDLE

  13. You Try

  14. IDLE T3-14 T10-18 T8-10 T1-1 T5-5 P1 T4-15 IDLE T6-9 P2 IDLE T9-17 T7-7 IDLE T2-12

  15. T8-10 T4-13 T10-16 T3-12 P1 T6-9 T1-1 T5-5 P2 T7-7 IDLE IDLE T9-15 P3 T2-10 IDLE IDLE

  16. Critical Path Schedules • Find a task that heads a critical (longest) path in the order-requirement digraph • Place the task found in step 1 next in the priority list • Remove the task found in step 1 from the digraph • If all tasks have been removed, the list is completed. If tasks remain return to step one.

  17. Critical path T5-12 T6-10 T3-7 P1 T8-16 P2 T4-10 T1-5 T2-8 T7-11

  18. You Try using 2 and 3 processors using critical path

  19. T9-15 T10-16 T1-1 T5-5 P1 T3-12 T2-10 P2 IDLE T6-9 T7-11 IDLE T4-13 T8-12

  20. Critical path algorithm on 3 processors T10-16 P1 T1-1 T3-12 T9-15 T5-5 T2-10 P2 T4-13 T6-9 IDLE T8-10 P3 T7-7 IDLE IDLE

  21. List process algorithm on 3 processors T8-10 T4-13 T10-16 T3-12 P1 T6-9 T1-1 T5-5 P2 T7-7 IDLE IDLE T9-15 P3 T2-10 IDLE IDLE

  22. Critical path algorithm on 2 processors T9-15 T10-16 T1-1 T5-5 P1 T3-12 T2-10 P2 IDLE T6-9 T7-11 IDLE T4-13 T8-12

  23. Critical path algorithm on 3 processors T10-16 P1 T1-1 T3-12 T9-15 T5-5 T2-10 P2 T4-13 T6-9 IDLE T8-10 P3 T7-7 IDLE IDLE

More Related