- Questions & Answers
- Accounting
- Computer Science
- Automata or Computationing
- Computer Architecture
- Computer Graphics and Multimedia Applications
- Computer Network Security
- Data Structures
- Database Management System
- Design and Analysis of Algorithms
- Information Technology
- Linux Environment
- Networking
- Operating System
- Software Engineering
- Big Data
- Android
- iOS
- Matlab

- Economics
- Engineering
- Finance
- Thesis
- Management
- Science/Math
- Statistics
- Writing
- Dissertations
- Essays
- Programming
- Healthcare
- Law

- Log in | Sign up

Test Data of Programming Assignment #4

A project of 13 tasks labeled 0,1,….,12 with the following data:

Task

Predecessors

Time needed for the task

0

Null

2

1

0

4

2

0

5

3

0

9

4

1

3

5

1,2,3

2

6

4,5

1

7

5

10

8

3

11

9

6,7

6

10

8

9

11

8

8

12

9,10,11

7

CS3310 Design and Analysis of Algorithms XXXXXXXXXXProgramming Assignment #4

The Critical Path Procedure (CPM) can be described as follows:

Method1:We assume there are a precedence constraints described by acyclic graph and there is only one final task( if there is no final task you may create a dummy task with zero time to complete).

The parameters ES(earliest start time ) , EF(earliest finish time), LS(latest start time), and LF(latest start time) of every task is computed by two passes through the graph. The first two parameters are computing during a forward pass from the initial tasks (those without any predecessor) to the final task as follows:

For each initial task ES=0 and EF= the time needed to complete the task

If the task A has P1 , P2,…Pk as immediate predecessor tasks , then ES of A = max(EF of P1 ,EF of P2,……,EF of Pk), and

EF of A = ES + the time needed to complete the task A

The parameters LS and LF are computed during a backward pass from the final task to the initial tasks as follows:

LS and LF of the final task are exactly ES and EF of the final task, respectively.

If the task B has P1, P2 ,…., Pk as immediate successor tasks, then LF of B= min( LS of P1, LS of P2,…..LS of Pk), and

LS of B= LF -the time needed to complete the task B.

Define the class Node which includes the attributes: Task Name, Time to complete the task, ES, EF, LS, and LF. Let T be an a

ay of n objects of type Node. The initial values of the four parameters ES, EF,LS, and LF are set to zero. The precedence constrains are defined by a graph represented by the adjacency matrix G. You may use the topological sorting algorithm for ordering the tasks( Why do we need topological sorting?).

Use the Class Node, the a

ay T, and the matrix G to write the Critical Path Method for computing the minimum completion time of a given project consists of many tasks, and determining the critical tasks and also determining the possible delay for each task without changing the minimum completion time. Assume the time needed to complete each task is given.

The parameter slack is defined for reach task as LS-ES. A task is critical if and only if its slack = 0

Slack is the amount of time that an activity can be delayed past its earliest start or earliest finish without delaying the project.

Method2:

As follows the outline for implementing this programming assignment:

Write an algorithm for computing the ES, EF, LS, and LF for every task using the following data structures:

The tasks are labeled 1, 2,….n.

The a

ays ES[], EF[] ,LS[] , LF[], and T[]

Where ES[i] represents the earliest start time of the task i;

EF[i] represents the earliest finish time of i;

LS[i] represents latest start time of the task i;

LF[i] represents latest finish time of the task I;

T[i] represents the required time to complete the task i.

The graph of the project is represented by the incidence matrix (adjacency matrix) A[][],

Where A[i][j] = 1 iff the task j is an immediate successor of the task i.

The a

ay TS[] represents the sequence of the tasks listed according to the Topological soring.

Note that If the task A has P1 , P2,…Pk as immediate predecessor tasks , then ES of A = max(EF of P1 ,EF of P2,……,EF of Pk), and

EF of A = ES + the time needed to complete the task A

The parameters LS and LF are computed during a backward pass from the final task to the initial tasks as follows:

If the task B has P1, P2 ,…., Pk as immediate successor tasks, then LF of B= min( LS of P1, LS of P2,…..LS of Pk), and

LS of B= LF -the time needed to complete the task B.

A project of 13 tasks labeled 0,1,….,12 with the following data:

Task

Predecessors

Time needed for the task

0

Null

2

1

0

4

2

0

5

3

0

9

4

1

3

5

1,2,3

2

6

4,5

1

7

5

10

8

3

11

9

6,7

6

10

8

9

11

8

8

12

9,10,11

7

CS3310 Design and Analysis of Algorithms XXXXXXXXXXProgramming Assignment #4

The Critical Path Procedure (CPM) can be described as follows:

Method1:We assume there are a precedence constraints described by acyclic graph and there is only one final task( if there is no final task you may create a dummy task with zero time to complete).

The parameters ES(earliest start time ) , EF(earliest finish time), LS(latest start time), and LF(latest start time) of every task is computed by two passes through the graph. The first two parameters are computing during a forward pass from the initial tasks (those without any predecessor) to the final task as follows:

For each initial task ES=0 and EF= the time needed to complete the task

If the task A has P1 , P2,…Pk as immediate predecessor tasks , then ES of A = max(EF of P1 ,EF of P2,……,EF of Pk), and

EF of A = ES + the time needed to complete the task A

The parameters LS and LF are computed during a backward pass from the final task to the initial tasks as follows:

LS and LF of the final task are exactly ES and EF of the final task, respectively.

If the task B has P1, P2 ,…., Pk as immediate successor tasks, then LF of B= min( LS of P1, LS of P2,…..LS of Pk), and

LS of B= LF -the time needed to complete the task B.

Define the class Node which includes the attributes: Task Name, Time to complete the task, ES, EF, LS, and LF. Let T be an a

ay of n objects of type Node. The initial values of the four parameters ES, EF,LS, and LF are set to zero. The precedence constrains are defined by a graph represented by the adjacency matrix G. You may use the topological sorting algorithm for ordering the tasks( Why do we need topological sorting?).

Use the Class Node, the a

ay T, and the matrix G to write the Critical Path Method for computing the minimum completion time of a given project consists of many tasks, and determining the critical tasks and also determining the possible delay for each task without changing the minimum completion time. Assume the time needed to complete each task is given.

The parameter slack is defined for reach task as LS-ES. A task is critical if and only if its slack = 0

Slack is the amount of time that an activity can be delayed past its earliest start or earliest finish without delaying the project.

Method2:

As follows the outline for implementing this programming assignment:

Write an algorithm for computing the ES, EF, LS, and LF for every task using the following data structures:

The tasks are labeled 1, 2,….n.

The a

ays ES[], EF[] ,LS[] , LF[], and T[]

Where ES[i] represents the earliest start time of the task i;

EF[i] represents the earliest finish time of i;

LS[i] represents latest start time of the task i;

LF[i] represents latest finish time of the task I;

T[i] represents the required time to complete the task i.

The graph of the project is represented by the incidence matrix (adjacency matrix) A[][],

Where A[i][j] = 1 iff the task j is an immediate successor of the task i.

The a

ay TS[] represents the sequence of the tasks listed according to the Topological soring.

Note that If the task A has P1 , P2,…Pk as immediate predecessor tasks , then ES of A = max(EF of P1 ,EF of P2,……,EF of Pk), and

EF of A = ES + the time needed to complete the task A

The parameters LS and LF are computed during a backward pass from the final task to the initial tasks as follows:

If the task B has P1, P2 ,…., Pk as immediate successor tasks, then LF of B= min( LS of P1, LS of P2,…..LS of Pk), and

LS of B= LF -the time needed to complete the task B.

Answered 7 days AfterAug 01, 2021

Assg/data.csv

Task,Predecessors,Time needed for the task

0,,2

1,0,4

2,0,5

3,0,9

4,1,3

5,1 2 3,2

6,4 5,1

7,5,10

8,3,11

9,6 7,6

10,8,9

11,8,8

12,9 10 11,7

End,9 10 11,7

Assg/output.png

Assg/test.py

import networkx as nx

import numpy as np

import pandas as pd

import pyla

def find_all_paths(graph, start, end, path=[]):

path = path + [start]

if start == end:

return [path]

if not start in graph.keys():

return []

paths = []

for node in graph[start]:

if node not in path:

newpaths = find_all_paths(graph, node, end, path)

for newpath in newpaths:

paths.append(newpath)

return paths

Df = pd.read_csv("data.csv")

graph_edges={x:[] for x in Df["Task"]}

weights ={k:int(v) for k,v in zip(Df["Task"],Df["Time needed for the task"])}

for index, row in Df.ite

ows():

if str(row["Predecessors"])=='nan':

pass

else:

acts=str(row["Predecessors"]).split(" ")

for act in acts:

...

Task,Predecessors,Time needed for the task

0,,2

1,0,4

2,0,5

3,0,9

4,1,3

5,1 2 3,2

6,4 5,1

7,5,10

8,3,11

9,6 7,6

10,8,9

11,8,8

12,9 10 11,7

End,9 10 11,7

Assg/output.png

Assg/test.py

import networkx as nx

import numpy as np

import pandas as pd

import pyla

def find_all_paths(graph, start, end, path=[]):

path = path + [start]

if start == end:

return [path]

if not start in graph.keys():

return []

paths = []

for node in graph[start]:

if node not in path:

newpaths = find_all_paths(graph, node, end, path)

for newpath in newpaths:

paths.append(newpath)

return paths

Df = pd.read_csv("data.csv")

graph_edges={x:[] for x in Df["Task"]}

weights ={k:int(v) for k,v in zip(Df["Task"],Df["Time needed for the task"])}

for index, row in Df.ite

ows():

if str(row["Predecessors"])=='nan':

pass

else:

acts=str(row["Predecessors"]).split(" ")

for act in acts:

...

SOLUTION.PDF## Answer To This Question Is Available To Download

- ASSESSMENT BRIEF COURSE: Bachelor of Business (Information Systems Specialisation) Unit Code: SYAD 310 Unit Title: Systems Analysis and Design Type of Assessment: Assessment 2 – Group Assignment...SolvedMay 16, 2022
- Hello!I'm having trouble with this past exercise and I can never seem to get it. Please help, thank you.SolvedMay 09, 2022
- Question 5: Version control (10%) Both parts of this question are about the admin application. 5(a) Advice on version control The admin team are aware that the application development must be...SolvedMay 08, 2022
- Question 2: Responsive design (30%) 2(a) ‘Add walk event’ page for laptop screen This part of the question is about the admin application. The admin team is keen to see some ideas for the visual...SolvedMay 08, 2022
- Assessment Brief: BIS2002/SBM4201 Systems Analysis and Design Trimester 1, 2022 Assessment Overview Assessment Task Type Weighting Length Due ULOs Assessed Assessment 1 Case Study Covers the following...SolvedMay 08, 2022
- CSS 220 Module 4 Homework Think about how many messages are sent electronically today. What are most common? Email, text messages, in-app messaging? And what kind of data gets sent? Is it secure? For...SolvedMay 07, 2022
- In particular, you must use the KNeighborsRegressor() in Scikit- What is the prediction of the 1-KNN algorithm using KNeighborsRegressor() ? What is the prediction of the 5-KNN algorithm using...SolvedMay 07, 2022
- The dataset for this question has 2 numerical descriptive features, carat and depth . Discretize these 2 features separately as "category_1", "category_2", and...SolvedMay 06, 2022
- Algorithms and Analysis COSC 2123/1285 Assignment 2: Algorithm Design & Complexity Analysis Assessment Type Individual Assignment. Submit online via Canvas → Assign- ments → Assignment 2....SolvedMay 06, 2022
- This is an Advanced Algorithms undergraduate Exam that will be taking place on 05/06/22 (Friday, May 6th, 2022) from 10:00 am to 11:00 am US central time. This is a 1 hour exam and the exam will have...SolvedMay 04, 2022

Copy and Paste Your Assignment Here

About Us | Contact Us | Help | Privacy Policy | Revision and Refund Policy | Terms & Conditions | Honor Code

Copyright © 2022. All rights reserved.