Skip to content
Snippets Groups Projects
Commit 67a0f9f2 authored by Yannik's avatar Yannik
Browse files

added Kernel track

parent f03c2f98
No related branches found
No related tags found
1 merge request!5added Kerneltrack
Pipeline #149725 passed
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
...@@ -33,7 +33,6 @@ public class PaceHeuristic { ...@@ -33,7 +33,6 @@ public class PaceHeuristic {
System.exit(-1); System.exit(-1);
} }
currentBest = getTrivialChanges(graph); currentBest = getTrivialChanges(graph);
while (!stop) { while (!stop) {
PositionGraph graphP = new PositionGraph(graph, 2); PositionGraph graphP = new PositionGraph(graph, 2);
LayoutUpperBoundHeuristic heuristic = new LayoutUpperBoundHeuristic(null); LayoutUpperBoundHeuristic heuristic = new LayoutUpperBoundHeuristic(null);
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cluster-editing</artifactId>
<groupId>de.uni.bremen</groupId>
<version>pace2021</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>Pace-Kernalisation</artifactId>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>de.uni.bremen</groupId>
<artifactId>Pace-Solver</artifactId>
<version>pace2021</version>
</dependency>
</dependencies>
<!-- !!! NICHT ANFASSEN !!! -->
<build>
<finalName>Pace-Kernalisation-Solver</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>de.uni.bremen.cluster.editing.kernelisation.Main</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>Jeigen:jeigen</artifact>
<excludes>
<exclude>**/msvc-redist/**</exclude>
<exclude>**/*-win-*.*</exclude>
<exclude>**/*-mac-*.*</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package de.uni.bremen.cluster.editing.kernelisation;
public class Main {
public static void main(final String... args) {
PaceKernelSolver solver = new PaceKernelSolver();
solver.solve();
}
}
package de.uni.bremen.cluster.editing.kernelisation;
import de.uni.bremen.cluster.editing.custom.graph.library.helper.ConsoleHelper;
import de.uni.bremen.cluster.editing.custom.graph.library.io.implementation.BasicUndirectedGraphStdInOutImportExporter;
import de.uni.bremen.cluster.editing.custom.graph.library.model.api.Edge;
import de.uni.bremen.cluster.editing.custom.graph.library.model.implementation.BasicUndirectedGraph;
import de.uni.bremen.cluster.editing.utilities.common.api.algorithm.Solver;
import de.uni.bremen.cluster.editing.utilities.solver.graphsplitter.GraphSplitterSolver;
import java.io.IOException;
public class PaceKernelSolver {
public void solve() {
//load Graph
ConsoleHelper.setDebug(false);
Solver.TRACKING = false;
BasicUndirectedGraphStdInOutImportExporter loader = new BasicUndirectedGraphStdInOutImportExporter();
BasicUndirectedGraph graph = null;
try {
graph = loader.loadAndCreate();
} catch (IOException e) {
e.printStackTrace();
}
//solve
Solver solver = new GraphSplitterSolver(graph);
solver.solve();
System.out.println(solver.getResultK());
System.out.println("p cep 0 0");
System.out.println(solver.getResultK());
printEdgeModifications(solver);
System.out.println(solver.getResultK());
printEdgeModifications(solver);
System.out.println(solver.getResultK());
printEdgeModifications(solver);
System.out.println(solver.getResultK());
printEdgeModifications(solver);
}
private void printEdgeModifications(Solver solver) {
for (Edge edge : solver.getChanges().getAddedEdges()) {
System.out.println((edge.getStartId()) + " " + (edge.getEndId()));
}
for (Edge edge : solver.getChanges().getRemovedEdges()) {
System.out.println((edge.getStartId()) + " " + (edge.getEndId()));
}
}
}
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<module>Pace-Solver</module> <module>Pace-Solver</module>
<module>Pace-Heuristic</module> <module>Pace-Heuristic</module>
<module>Custom-Graph-Library</module> <module>Custom-Graph-Library</module>
<module>Pace-Kernelisation</module>
</modules> </modules>
<properties> <properties>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment