Given a directed graph input, G, the code should do the following:
1. Output all the vertices that have the same in and out degrees
2. Output the average in-degree and the average out-degree of vertices
3. Test if G has a cycle
4. If G has a cycle, then the code should output at least one cycle,
else the code should output topological ordering of G
5. Test if G has at most 3 cycles
See example inputs and outputs in the hw4.pdf
file and in the .txt
files
You must have a JRE (Java Runtime Environment) installed. You can download it here
- Download the executable
softeng250-hw4.jar
file - Open up the Command Prompt (Windows) or the Terminal (Mac)
- Navigate to the directory where this file is located
- Use
cd 'insertfolderpath'
without the quotation marks
- Use
- Use
java -jar softeng250-hw4.jar
to execute the file
- Download this repository
- Extract the
.zip
file into a directory of your choice - Open up the Command Prompt (Windows) or the Terminal (Mac)
- Navigate to the extracted folder
softeng250-hw4-master
- Use
cd 'insertfolderpath'
without the quotation marks
- Use
- Use
javac -cp ./ src/hw4/Main.java
- Use
java src/hw4/Main