1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Klio2033 [76]
3 years ago
12

Your job is to prepare a lineup of n awardees at an award ceremony. You are given a list of m constraints of the form "i wants t

o receive an award before j." If you violate a constraint, it might upset the affected award recipient (i) and then i may leave the ceremony. Give an algorithm that prepares such a lineup, (or says that it is not possible) in O ( m + n ) time.
Mathematics
1 answer:
DanielleElmas [232]3 years ago
6 0

Answer:

The idea is to use the concept of topological sorting.

Complexity of this algorithm is equal to complexity of DFS algorithm, that is, O(m+n).

Step-by-step explanation:

The idea is to use the concept of topological sorting.

A topological sort also called a topological ordering of a directed graph is a linear ordering of its vertices in a way that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering. For instance, the vertices of the graph may represent tasks to be performed, and the edges may represent constraints that one task must be performed before another; in this application, a topological ordering is just a valid sequence for the tasks.

A topological sorting is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph (DAG).

For every edge (U - - >V), create a directed edge from U to V.

While creating an edge, if an edge creates a cycle, then it is not possible.

n= number of awardees

m= the number of constraint

Let n represent the vertices of a graph and constraints m is representing edges of a graph.

and graph is represented in adjacent of O(m+n)

Constraint i wants to receive award before j

Graphical representation - - - - - > (i) - - - - - - > (j) j depends on i

1. Presently run topological olding on graph G(n, m) where n is vertices and m is edges.

2. Run DFs on Graph, a temporary stack

3. Firstly call topological sorting for all its adjacent vertices and then push it to a stack. Finally, print content of stack.

4. Vertex is push to stack only when all adjacent vertices are already in stack.

Complexity of this algorithm is equal to complexity of DFS algorithm, that is, O(m+n).

You might be interested in
Which inequality is represented by this graph?
erastovalidia [21]

Answer:the last one I’m not really sure

8 0
3 years ago
Suppose the supply function for a certain item is given by S(q)= (q+6)2 and the demand funtion is given by D(q)= (1000)/(q+6).
nasty-shy [4]

Answer: The equilibrium point is where; Quantity supplied = 100 and Quantity demanded = 100

Step-by-step explanation: The equilibrium point on a demand and supply graph is the point at which demand equals supply. Better put, it is the point where the demand curve intersects the supply curve.

The supply function is given as

S(q) = (q + 6)^2

The demand function is given as

D(q) = 1000/(q + 6)

The equilibrium point therefore would be derived as

(q + 6)^2 = 1000/(q + 6)

Cross multiply and you have

(q + 6)^2 x (q + 6) = 1000

(q + 6 )^3 = 1000

Add the cube root sign to both sides of the equation

q + 6 = 10

Subtract 6 from both sides of the equation

q = 4

Therefore when q = 4, supply would be

S(q) = (4 + 6)^2

S(q) = 10^2

S(q) = 100

Also when q = 4, demand would be

D(q) = 1000/(4 + 6)

D(q) = 1000/10

D(q) = 100

Hence at the point of equilibrium the quantity demanded and quantity supplied would be 100 units.

7 0
3 years ago
Being a real estate agent can be a lucrative career choice if you’re willing to put in the hours. most real estate agents are pa
ASHA 777 [7]

Answer:

15,300 + 18750 + 13,500 + 23,400 +19500 = 90,450

Step-by-step explanation:

divide all the numbers by 100, then multiplying by 3

7 0
3 years ago
EXPLAIN PLEASE!!
Anestetic [448]
It’s 28 because if 2 + 2 = your adopted then it’s 28
6 0
3 years ago
Read 2 more answers
What is the y-intercept of he function f(x)=4-5x
trapecia [35]
I'm thinking that its 4 because.....
you add 5x on each side, u put the 5 in the parenthesis and replace the x with 5 then you'll end up having f(5)=4. How's that?
4 0
3 years ago
Other questions:
  • Solve the compound inequality 8x > –32 or 6x ≤ –48.
    11·2 answers
  • In the figure,BC andAD are line segments. What is the sum of x and y?
    11·1 answer
  • Which of these expressions shows a correct way to set up the slope formula for the line that passes through the points (3, 7) an
    7·1 answer
  • Tyler saved 1/3 as much as kara. tyler saved $55. write an equation to find how much kara saved?
    7·1 answer
  • I need help with this cause I'm terrible at Geometry, and I don't get a single thing
    12·1 answer
  • 25 points!<br> Just checking is the answer<br> 20y^8y^3
    10·2 answers
  • If the length of FG is 6 units, what is the length of EH?
    5·1 answer
  • Stefan sells Jin a bicycle for ​$125 and a helmet for ​$18. The total cost for Jin is ​130% of what Stefan spent originally to b
    6·1 answer
  • Point T Is the incenter of PQR.Point T is the point of concurrency of the angle bisector. Find ST.
    12·1 answer
  • It takes Billy 40 minutes to drive to his friends house at his normal speed but it takes two hours if he drives 20 mph slower ho
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!