GraphIO is a program developed in Java 17 for the calculation and representation of subareas of graph theory. It was developed as part of a programming assignment in the subject POS (graph theory).
GraphIO ist ein in Java 17 entwickeltes Programm zur Berechnung und Darstellung von Teilbereichen der Graphentheorie. Es wurde im Rahmen einer Programmieraufgabe im Fach POS (Graphentheorie) entwickelt.
- Importing matrices from CSV files as a adjacency matrix
- Calculating distance matrices
- Calculating eccentricities
- Calculating radius
- Calculating diameter
- Calculating center
- Calculating path matrices
- Calculating components
- Calculating articulations
- Calculating bridges
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
}
}
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
DistanceMatrix distanceMatrix = new DistanceMatrix(adjacencyMatrix);
distanceMatrix.printMatrix();
}
}
0|1|2|2|3|4|4|4|4|5|5|5|6|6|7|7|6|8|8|7|7|8|9|9|
1|0|1|1|2|3|3|3|3|4|4|4|5|5|6|6|5|7|7|6|6|7|8|8|
2|1|0|1|1|2|2|2|2|3|3|3|4|4|5|5|4|6|6|5|5|6|7|7|
2|1|1|0|1|2|2|2|2|3|3|3|4|4|5|5|4|6|6|5|5|6|7|7|
3|2|1|1|0|1|1|1|1|2|2|2|3|3|4|4|3|5|5|4|4|5|6|6|
4|3|2|2|1|0|1|2|2|3|3|2|3|4|5|5|4|6|6|5|5|6|7|7|
4|3|2|2|1|1|0|2|2|3|3|1|2|4|5|5|4|6|6|5|5|6|7|7|
4|3|2|2|1|2|2|0|1|1|1|3|4|2|3|3|2|4|4|3|3|4|5|5|
4|3|2|2|1|2|2|1|0|2|2|3|4|3|4|4|3|5|5|4|4|5|6|6|
5|4|3|3|2|3|3|1|2|0|1|4|5|2|3|3|2|4|4|3|3|4|5|5|
5|4|3|3|2|3|3|1|2|1|0|4|5|1|2|2|1|3|3|2|2|3|4|4|
5|4|3|3|2|2|1|3|3|4|4|0|1|5|6|6|5|7|7|6|6|7|8|8|
6|5|4|4|3|3|2|4|4|5|5|1|0|6|7|7|6|8|8|7|7|8|9|9|
6|5|4|4|3|4|4|2|3|2|1|5|6|0|1|2|2|2|2|3|3|4|5|5|
7|6|5|5|4|5|5|3|4|3|2|6|7|1|0|1|2|1|1|3|3|4|5|5|
7|6|5|5|4|5|5|3|4|3|2|6|7|2|1|0|1|2|2|2|2|3|4|4|
6|5|4|4|3|4|4|2|3|2|1|5|6|2|2|1|0|3|3|1|1|2|3|3|
8|7|6|6|5|6|6|4|5|4|3|7|8|2|1|2|3|0|1|4|4|5|6|6|
8|7|6|6|5|6|6|4|5|4|3|7|8|2|1|2|3|1|0|4|4|5|6|6|
7|6|5|5|4|5|5|3|4|3|2|6|7|3|3|2|1|4|4|0|1|2|3|3|
7|6|5|5|4|5|5|3|4|3|2|6|7|3|3|2|1|4|4|1|0|1|2|2|
8|7|6|6|5|6|6|4|5|4|3|7|8|4|4|3|2|5|5|2|1|0|1|1|
9|8|7|7|6|7|7|5|6|5|4|8|9|5|5|4|3|6|6|3|2|1|0|1|
9|8|7|7|6|7|7|5|6|5|4|8|9|5|5|4|3|6|6|3|2|1|1|0|
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
DistanceMatrix distanceMatrix = new DistanceMatrix(adjacencyMatrix);
Eccentricity eccentricity = new Eccentricity(distanceMatrix);
eccentricity.printEccentricity();
}
}
{A=9, B=8, C=7, D=7, E=6, F=7, G=7, H=5, I=6, J=5, K=5, L=8, M=9, N=6, O=7, P=7, Q=6, R=8, S=8, T=7, U=7, V=8, W=9, X=9}
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
DistanceMatrix distanceMatrix = new DistanceMatrix(adjacencyMatrix);
Eccentricity eccentricity = new Eccentricity(distanceMatrix);
eccentricity.printRadius();
}
}
rad(G) = 5
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
DistanceMatrix distanceMatrix = new DistanceMatrix(adjacencyMatrix);
Eccentricity eccentricity = new Eccentricity(distanceMatrix);
eccentricity.printDiameter();
}
}
dm(G) = 9
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
DistanceMatrix distanceMatrix = new DistanceMatrix(adjacencyMatrix);
Eccentricity eccentricity = new Eccentricity(distanceMatrix);
eccentricity.printCenter();
}
}
Z(G) = {H,J,K}
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
PathMatrix pathMatrix = new PathMatrix(adjacencyMatrix);
pathMatrix.printMatrix();
}
}
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
PathMatrix pathMatrix = new PathMatrix(adjacencyMatrix);
Components components = new Components(pathMatrix);
components.print();
}
}
c(G) = 1
K₁ = (K(1), {A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X})
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
PathMatrix pathMatrix = new PathMatrix(adjacencyMatrix);
Components components = new Components(pathMatrix);
Articulation articulation = new Articulation(adjacencyMatrix, components.getComponents().size());
articulation.print();
}
}
B E G H K L O Q U V
class Test {
public static void main(String[] args) {
AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix("PATH-TO-YOUR-CSV-FILE");
PathMatrix pathMatrix = new PathMatrix(adjacencyMatrix);
Components components = new Components(pathMatrix);
Bridges bridges = new Bridges(adjacencyMatrix, components.getComponents().size());
bridges.print();
}
}
[A,B]
[B,A]
[G,L]
[L,G]
[L,M]
[M,L]
[U,V]
[V,U]
👤 Jovan Stojimirovic
- GitHub: @stoyboy
Give a ⭐️ if this project helped you!
Copyright © 2022 Jovan Stojimirovic.
This project is MIT licensed.