Question

Using the data structure concept of topological ordering, demonstrate using pseudocode (please don't provide the actual...

Using the data structure concept of topological ordering, demonstrate using pseudocode (please don't provide the actual codings) how you can implement an operation to schedule picking during a delivery process in a warehouse.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Topological order can only be done on directed acyclic graph(DAG) where if directed edge (u,v) exist in graph G then vertex u will always come before vertex v in topological order.

Thus topological order gives an order of executing tasks by representing the tasks as directed graph with vertices represent task and edge represent task dependency and then perform the task as per topological order in which dependency is taken care by first performing independent tasks before dependent task.

Below is the pseudocode of using topological sort on delivery process.

SCHEDULE_ORDER(H,n) //H is the list of spot of picking and n is size of list

1. From task list (H,n) create a directed graph G(V,E) with vertices representing picking spot and directed edge (u,v) is created if spot u has to be covered before spot v.

//Now we will do topological sort as follows

2. Perfrom Depth-First-Search(DFS) on G and record the start and finish time of visiting vertices in G.

3. Now sort the vertices in G based on decreasing order of finish time, which is the required topological order.

4. If there is edge(u,v) such that finish_time(u) < finish_time(v) then this means graph G contains cycle and hence topological order does not exist.

5. Otherwise perform the task as per the topological order.

Thus topological order is obtain by performing DFS and then order the vertices in descending value of finish_time of visiting vertices.

Please comment for any clarification .

Add a comment
Know the answer?
Add Answer to:
Using the data structure concept of topological ordering, demonstrate using pseudocode (please don't provide the actual...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. How can you implement a queue data structure using a doubly linked list? Do you think it is necessary to use a doubl...

    3. How can you implement a queue data structure using a doubly linked list? Do you think it is necessary to use a doubly linked list rather than a singly linked list or not?(3 marks) 3. How can you implement a queue data structure using a doubly linked list? Do you think it is necessary to use a doubly linked list rather than a singly linked list or not?(3 marks)

  • I need new and unique answers, please. (Use your own words, don't copy and paste), Please...

    I need new and unique answers, please. (Use your own words, don't copy and paste), Please Use your keyboard (Don't use handwriting) Thank you.. The paper essay assignment must be 2 pages (500 words) , if you can please i need references According to the WHO, the recent Coronavirus 2019 (2019-nCoV) outbreak was firstly reported on December 31, 2019 in China. This virus is growing rapidly, and the health organizations are working hard to reduce the number of cases. As...

  • Please don't copy your answer from the web, this needs to pass plagiarism check! Q. Describe...

    Please don't copy your answer from the web, this needs to pass plagiarism check! Q. Describe and provide relevant examples in support for the following: a) Describe how Data Analytics can support the decision makers in Human Resource department. Support your answer with key HR Metrics used in Data Analytics. b) Explain how workforce analysis can be an effective process in maintaining the human capital plan? c) Write a note on different approaches taken in the process of Learning Management...

  • Show steps. Please. 3. Design a data structure D that can store integers. The data structure...

    Show steps. Please. 3. Design a data structure D that can store integers. The data structure should be ale to store nent can appear multiple times. The da the following operations in O(log n) time, where n is the number of distinct integers stored in D . add(x): Adds/inserts integer a into D. Even if belongs to D, z should still be added .frequencyx) Nuber of times r appears in D search(x): Returns true if is in D order (y):...

  • The task of this project is to implement in Java Hash Table structure using Linear Probing...

    The task of this project is to implement in Java Hash Table structure using Linear Probing Collision Strategy.   You can assume that no duplicates or allowed and perform lazy deletion (similar to BST). Specification Create a generic class called HashTableLinearProbe <K,V>, where K is the key and V is the value. It should contain a private static class, HashEntry<K,V>. Use this class to create array to represent Hashtable:             HashEntry<K,V> hashtable[]; Implement all methods listed below and test each method...

  • Please Use your keyboard (Don't use handwriting) Thank you.. PHC 274 I need new and unique...

    Please Use your keyboard (Don't use handwriting) Thank you.. PHC 274 I need new and unique answers, please. (Use your own words, don't copy and paste)*** According to the WHO, the recent Coronavirus 2019 (2019-nCoV) outbreak was firstly reported on December 31, 2019 in China. This virus is growing rapidly, and the health organizations are working hard to reduce the number of cases. As a public health official, using the Public Health Pyramid levels, explain how we can plan, implement,...

  • Please Write Pseudocode or Python code! Thanks! P1. b) is the following: W1. (6 marks) Write...

    Please Write Pseudocode or Python code! Thanks! P1. b) is the following: W1. (6 marks) Write the pseudocode for removing and returning only the second element from the Stack. The top element of the Stack will remain the top element after this operation. You may assume that the Stack contains at least two items before this operation. (a) Write the algorithm as a provider implementing a Stack using a contiguous memory implementation. You can refer to the implementation given in...

  • Can anyone please help with this 4 part case study? a. What categories of data (provide...

    Can anyone please help with this 4 part case study? a. What categories of data (provide definitions as well) would you expect to collect in this admission interview? b. Describe the characteristics of collected data and their impact on collected data c. Where could you find helpful data sources? d. Describe the role of observation in competent nursing care. 2. You receive a patient as a direct admission from a physician's office. During the patient's transfer from the wheelchair to...

  • In this lab, using C++, you will create an abstract data type, using a doubly-linked circular...

    In this lab, using C++, you will create an abstract data type, using a doubly-linked circular structure to store the values and links. You must create it by your own and not use any existing containers. You will need a QueueNode. You can use a struct for this, as each node will not have any associated functions. It will have members for data, and the next and previous pointers. Data will be positive integers. There will be no NULL pointers....

  • Using Structs within Structs Refer to the Structure on page 624 in the 7th Edition of...

    Using Structs within Structs Refer to the Structure on page 624 in the 7th Edition of the Malik Textbook (link is on this site) which defines EmployeeType as a struc with OTHER structs as its members. You can also refer to p.622 in order to see how to access the information. ======================================================================================= Design and Implement a program that will read from a file all the elements needed to fill/ INPUT DATA for the entire structure for up to- 5 Employees...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT