Login

Graphs and Cycles (Java)

School project
Finished
19 October 2006

Oblig 4:

In this assignment you are given some files that you have to read in to your program.
The file that needs to be read in could look like this:

1|Sette opp vegger|4|2|5
2|Sette opp tak|6|4|1
3|Klistre tapet|1|2|1|2
4|Legge takstein|1|3|2
5|Bygge grunnmur|4|2
6|Legge gulv|2|2|5
7|Legge gulvbelegg|4|2|6|2
8|Flytte inn|4|4|3|7

These numbers would be read as:
Activity number 1 is sette opp vegger.
This activity would take 4 days, and needs 2 persons.
Before you can do this activity, activity 5 has to be done.

From this input you then have to create a virtual graph system over all workprossess with dependencies taken into considerations.
The example above would look like this in a graphform:

SEE FIRST PICTURE BELOW

The assignment should be solved in three different parts.

Nr 1: Read in from file and create the graph.

Nr 2: Do a check on the graph for cycles.
- Do a topological sorting. If this don't find all the nodes in the graph you have some cycles.

Nr 3: Convert the graph into output for the user to read.
- You have to convert the activity graph to a occurrence graph.

The output to the user should be something like this (from the example):

----------------------------------------------------------------------
Time : 0
Start ( 5) Bygge grunnmur

Persons in work: 2
----------------------------------------------------------------------
Time : 4
Stop ( 5) Bygge grunnmur
Start ( 6) Legge gulv
Start ( 1) Sette opp vegger

Persons in work: 4
----------------------------------------------------------------------
Time : 6
Stop ( 6) Legge gulv

Persons in work: 2
----------------------------------------------------------------------
Time : 8
Stop ( 1) Sette opp vegger
Start ( 2) Sette opp tak

Persons in work: 4
----------------------------------------------------------------------
Time : 14
Stop ( 2) Sette opp tak
Start ( 3) Klistre tapet
Start ( 7) Legge gulvbelegg
Start ( 4) Legge takstein

Persons in work: 7
----------------------------------------------------------------------
Time : 15
Stop ( 3) Klistre tapet
Stop ( 4) Legge takstein

Persons in work: 2
----------------------------------------------------------------------
Time : 18
Stop( 7) Legge gulvbelegg
Start ( 8) Flytte inn

Persons in work: 4
----------------------------------------------------------------------
Time : 22 Stop ( 8) Flytte inn
======================================================
Last possible accomplishment time: 22
======================================================

Grade: C

You have to be logged in to download the project files!
If you are interested in the project files then contact me