new random graph feature (#6)

* new folder with csv

* more files

* improvements

* new method

* quick fix

* revert

* Too tired to write descriptive message

* can now create random graphs

* random graph with 50 nodes
This commit is contained in:
René Fuhry 2023-05-26 12:41:13 +02:00 committed by GitHub
parent e95b94ec7b
commit b636e22e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 223 additions and 3 deletions

24
csv/24n.csv Normal file
View File

@ -0,0 +1,24 @@
0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1;0;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;1;0;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;1;1;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;1;1;0;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;1;0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;0;0;0;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;1;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;1;0;1;0;0;0;1;0;0;1;0;0;0;0;0;0;0
0;0;0;0;0;0;1;0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;0;0;0;1;0;0;0;1;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;1;0;1;1;0;0;0;0;0
0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;1;0;0;0;0;0;0;0
0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;1;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
0;0;1;1;0
1 0 0 1 0 0
2 0 0 1 0 0
3 1 1 0 1 1
4 0 0 1 0 1
5 0 0 1 1 0

View File

@ -86,6 +86,7 @@ public class Graph {
public void calculateExzentrizitäten() { public void calculateExzentrizitäten() {
exzentrizitäten = new ArrayList<>(1); exzentrizitäten = new ArrayList<>(1);
connected = true;
for(int rowIndex = 0; rowIndex < distanzMatrix.getRowLength(); rowIndex++) { for(int rowIndex = 0; rowIndex < distanzMatrix.getRowLength(); rowIndex++) {
int exzentrizität = 0; int exzentrizität = 0;
@ -110,7 +111,6 @@ public class Graph {
radius = Integer.MAX_VALUE; radius = Integer.MAX_VALUE;
diameter = -1; diameter = -1;
connected = true;
centre = new ArrayList<>(1); centre = new ArrayList<>(1);
for(int rowIndex = 0; rowIndex < exzentrizitäten.size(); rowIndex++) { for(int rowIndex = 0; rowIndex < exzentrizitäten.size(); rowIndex++) {

View File

@ -1,7 +1,10 @@
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.util.Random;
import java.io.FileReader; import java.io.FileReader;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class Matrix { public class Matrix {
private int[][] matrix; private int[][] matrix;
@ -10,6 +13,19 @@ public class Matrix {
public static void main(String[] args) {} public static void main(String[] args) {}
public Matrix(int rowLength, int columnLength, boolean random) {
if(!random) {
matrix = new int[rowLength][columnLength];
this.rowLength = rowLength;
this.columnLength = columnLength;
return;
}
matrix = new int[rowLength][columnLength];
this.rowLength = rowLength;
this.columnLength = columnLength;
randomAdjazenzMatrix();
}
public Matrix(String file) { public Matrix(String file) {
readCSV(file); readCSV(file);
} }
@ -79,6 +95,49 @@ public class Matrix {
} }
} }
public int[][] clone() {
int[][] clone = new int[rowLength][columnLength];
for(int columnIndex=0; columnIndex < columnLength; columnIndex++) {
for(int rowIndex=0; rowIndex < rowLength; rowIndex++) {
clone[rowIndex][columnIndex] = matrix[rowIndex][columnIndex];
}
}
return clone;
}
public void randomAdjazenzMatrix() {
Random r = new Random();
for(int columnIndex=0; columnIndex < columnLength; columnIndex++) {
for(int rowIndex=0; rowIndex < rowLength; rowIndex++) {
if(rowIndex == columnIndex) {
continue;
}
matrix[rowIndex][columnIndex] = r.nextInt(2);
}
}
}
public void WriteToCsv(String filename) {
String s = "";
try (BufferedWriter bw = new BufferedWriter(new FileWriter(filename))) {
for(int columnIndex=0; columnIndex < columnLength; columnIndex++) {
s = "";
for(int rowIndex=0; rowIndex < rowLength; rowIndex++) {
s += matrix[columnIndex][rowIndex];
if(rowIndex < rowLength - 1) {
s += ";";
}
}
bw.write(s + "\n");
}
} catch (IOException e) {
e.printStackTrace();
}
}
public String toString() { public String toString() {
String s = ""; String s = "";
for(int columnIndex=0; columnIndex < columnLength; columnIndex++) { for(int columnIndex=0; columnIndex < columnLength; columnIndex++) {

View File

@ -1,6 +1,53 @@
public class TestGraph { public class TestGraph {
public static void main(String[] args) { public static void main(String[] args) {
Graph g = new Graph(""); // test1();
// test2();
// test3();
// test4();
test5();
}
static String pathToProgramRoot = "/home/rene/projects/Java/graphprogram";
/*
* This is a small not connected graph with articulations and bridges
*/
public static void test1() {
Graph g = new Graph(pathToProgramRoot + "/csv/5n.csv");
System.out.println(g);
}
/*
* Bigger graph with bridges and many articulations
*/
public static void test2() {
Graph g = new Graph(pathToProgramRoot + "/csv/24n.csv");
System.out.println(g);
}
/*
* Graph where each vetex is not connected to anything
*/
public static void test3() {
Graph g = new Graph(pathToProgramRoot + "/csv/empty.csv");
System.out.println(g);
}
/*
* small connected graph with one articulation and one bridge
*/
public static void test4() {
Graph g = new Graph(pathToProgramRoot + "/csv/art-brck.csv");
System.out.println(g);
}
/*
* randomly generated graph with x nodes
*/
public static void test5() {
Graph g = new Graph(pathToProgramRoot + "/csv/50n.csv");
System.out.println(g); System.out.println(g);
} }
} }

View File

@ -1,6 +1,14 @@
public class TestMatrix { public class TestMatrix {
public static void main(String[] args) { public static void main(String[] args) {
Matrix matrix = new Matrix(""); // test1();
// test2();
createCsv();
}
public static void test1() {
String pathToProgramRoot = "/home/rene/projects/grpahprogram";
Matrix matrix = new Matrix(pathToProgramRoot + "/csv/graph.csv");
Matrix scalarProduct; Matrix scalarProduct;
System.out.println("RowLength: " + matrix.getRowLength()); System.out.println("RowLength: " + matrix.getRowLength());
@ -11,4 +19,14 @@ public class TestMatrix {
scalarProduct = matrix.multiply(matrix); scalarProduct = matrix.multiply(matrix);
System.out.println("\nScalarProduct A²: \n" + scalarProduct); System.out.println("\nScalarProduct A²: \n" + scalarProduct);
} }
public static void test2() {
Matrix bruh = new Matrix(10, 10, true);
System.out.println(bruh);
}
public static void createCsv() {
Matrix bruh = new Matrix(50, 50, true);
bruh.WriteToCsv("csv/50n.csv");
}
} }