Fehler beim Abbruch einer Simulation behoben
This commit is contained in:
parent
aa431abc4d
commit
c254b039b3
47 changed files with 436 additions and 221 deletions
|
|
@ -9,23 +9,23 @@ import javafx.scene.control.Alert.AlertType;
|
|||
import javafx.scene.control.ButtonType;
|
||||
import javafx.application.Platform;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* description
|
||||
* Abstrakte Oberklasse für alle zu simulierende Algorithmen
|
||||
* Diese müssen die Methode getBezeichnung(): String und fuehreAlgorithmusAus() überschreiben.
|
||||
*
|
||||
* @version 1.0 from 26.04.2019
|
||||
* @author
|
||||
* @version 6.7 (Dez. 2020)
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
public abstract class GraphAlgo extends Thread {
|
||||
|
||||
// Anfang Attribute
|
||||
private boolean stepping;
|
||||
private boolean waitforrepaint;
|
||||
private boolean waitforclick;
|
||||
protected boolean inArbeit;
|
||||
private GraphPlotter gp;
|
||||
private boolean stepping; // Einzelschrittmodus
|
||||
private boolean waitforrepaint; // wird gerade gezeichnet (=> nicht nochmal zeichnen beauftragen)
|
||||
private boolean waitforclick; // wird auf Klick für nächsten Step gewartet
|
||||
protected boolean inArbeit;
|
||||
protected GraphPlotter gp;
|
||||
private Knoten startKnoten;
|
||||
private int speed =100;
|
||||
private Hilfe hilfe;
|
||||
|
|
@ -34,6 +34,9 @@ public abstract class GraphAlgo extends Thread {
|
|||
// Ende Attribute
|
||||
|
||||
// Anfang Methoden
|
||||
/**
|
||||
* Erzeugt neues Algorithmus-Objekt
|
||||
*/
|
||||
public GraphAlgo() {
|
||||
stepping = true;
|
||||
waitforrepaint = false;
|
||||
|
|
@ -42,31 +45,53 @@ public abstract class GraphAlgo extends Thread {
|
|||
setDaemon(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setzt die Referenz auf die GraphAnzeige und das Hilfefenster
|
||||
* @param graphPlotter
|
||||
* @param hilfe
|
||||
*/
|
||||
public void setGUIElemente(GraphPlotter graphPlotter, Hilfe hilfe) {
|
||||
gp = graphPlotter;
|
||||
g = gp.getGraph();
|
||||
this.hilfe = hilfe;
|
||||
if (hilfe != null) hilfe.setGraphPlotter(gp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setzt Referenz auf den Graphen
|
||||
* @param g Graph auf den der Algorithmus angewendet wird
|
||||
*/
|
||||
public void setGraph(Graph g) {
|
||||
this.g = g;
|
||||
gp = null;
|
||||
hilfe = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt Referenz auf den Graphen zurück
|
||||
* @return g Graph, auf den der Algorithmus angewendet wird
|
||||
*/
|
||||
public Graph getGraph() {
|
||||
return g;
|
||||
}
|
||||
|
||||
/**
|
||||
* Muss vom Algorithmus aufgerufen werden, um einen Haltepunkt zu setzen
|
||||
*/
|
||||
public void step() {
|
||||
if(gp == null) return;
|
||||
try{
|
||||
//System.out.println("Step");
|
||||
gp.updateImage();
|
||||
aktuellerZustand = g.getStatus();
|
||||
waitforclick = true;
|
||||
if (hilfe != null) hilfe.setReviewAllowed(true);
|
||||
int i = 0;
|
||||
while((waitforclick && (stepping || i*10 < speed)) && !isInterrupted()){
|
||||
Thread.sleep(10);
|
||||
i++;
|
||||
Thread.sleep(10);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (hilfe != null) hilfe.setReviewAllowed(false);
|
||||
g.setStatus(aktuellerZustand);
|
||||
aktuellerZustand = null;
|
||||
|
|
@ -76,30 +101,41 @@ public abstract class GraphAlgo extends Thread {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean getWaitforrepaint() {
|
||||
return waitforrepaint;
|
||||
}
|
||||
|
||||
public void setWaitforrepaint(boolean waitforrepaintNeu) {
|
||||
waitforrepaint = waitforrepaintNeu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wird gerade auf einen Buttonklick für den nächsten Step gewartet?
|
||||
* @return true/false
|
||||
*/
|
||||
public boolean getWaitforclick() {
|
||||
return waitforclick;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setzt, ob gewartet wird. Damit kann übermittelt werden, dass der Button gedrückt wurde
|
||||
* @param wairforclickNeu Soll weiter gewartet werden?
|
||||
*/
|
||||
public void setWaitforclick(boolean waitforclickNeu) {
|
||||
waitforclick = waitforclickNeu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setzt, ob im Einzelschrittmodus ausgeführt werden soll
|
||||
* @param stepping true/false
|
||||
*/
|
||||
public void setStepping(boolean stepping) {
|
||||
this.stepping = stepping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setzt die Wartezeit im automatischen Modus
|
||||
* @param delay Wartezeit
|
||||
*/
|
||||
public void setSpeed(int delay) {
|
||||
this.speed = delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ausführung des Algorithmus
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
if(!inArbeit && gp != null)
|
||||
|
|
@ -109,9 +145,10 @@ public abstract class GraphAlgo extends Thread {
|
|||
try{
|
||||
if (hilfe != null) hilfe.setReviewAllowed(false);
|
||||
fuehreAlgorithmusAus();
|
||||
gp.updateImage();
|
||||
// System.out.println("Algorithmus beendet");
|
||||
} catch( ThreadDeath e){
|
||||
// System.out.println("Algorithmus vorzeitig beendet.");
|
||||
// System.out.println("Algorithmus vorzeitig beendet."+e);
|
||||
}
|
||||
if (hilfe != null) hilfe.setReviewAllowed(true);
|
||||
inArbeit = false;
|
||||
|
|
@ -124,10 +161,18 @@ public abstract class GraphAlgo extends Thread {
|
|||
}
|
||||
// Ende Methoden
|
||||
|
||||
/**
|
||||
* Setzen des Startknotens
|
||||
* @param k Startknoten
|
||||
*/
|
||||
public void setStartKnoten(Knoten k) {
|
||||
startKnoten = k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abfragen des Startknotens für den Algorithmus
|
||||
* @return gesetzter Startknoten oder Knoten Nr. 0
|
||||
*/
|
||||
public Knoten getStartKnoten() {
|
||||
if (startKnoten != null) {
|
||||
return startKnoten;
|
||||
|
|
@ -136,37 +181,79 @@ public abstract class GraphAlgo extends Thread {
|
|||
} // end of if-else
|
||||
}
|
||||
|
||||
/**
|
||||
* Methode für den eigentlichen Algorithmus
|
||||
*/
|
||||
public abstract void fuehreAlgorithmusAus();
|
||||
|
||||
/**
|
||||
* Name des Algorithmus für die Dropdown-Auswahl
|
||||
*/
|
||||
public abstract String getBezeichnung();
|
||||
|
||||
/**
|
||||
* Öffnet ein Anzeigefenster mit einer Meldung. Die
|
||||
* Meldung wird ggf. auch im Hilfefenster angezeigt.
|
||||
* Ist für die Verwendung im Algorithmus gedacht.
|
||||
* @param s Meldung
|
||||
*/
|
||||
public void melde(String s) {
|
||||
info(s);
|
||||
Platform.runLater(() -> {
|
||||
Alert meldung = new Alert(AlertType.INFORMATION, s, ButtonType.OK);
|
||||
meldung.setTitle("Information");
|
||||
meldung.setHeaderText(null);
|
||||
meldung.showAndWait();
|
||||
Alert meldung = new Alert(AlertType.INFORMATION, s, ButtonType.OK);
|
||||
meldung.setTitle("Information");
|
||||
meldung.setHeaderText(null);
|
||||
meldung.showAndWait();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Text in das Hilfefenster einfügen
|
||||
* Ist für die Verwendung im Algorithmus gedacht.
|
||||
* @param s Hilfetext
|
||||
*/
|
||||
public void info(String s) {
|
||||
if(hilfe != null) hilfe.append(s+"\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Löscht das Hilfefenster
|
||||
*/
|
||||
public void resetInfo() {
|
||||
if(hilfe != null) hilfe.loescheAlles();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rückt im Hilfefenster eine Ebene tiefer ein.
|
||||
* Ist für die Verwendung im Algorithmus gedacht.
|
||||
*/
|
||||
public void infoIndentMore() {
|
||||
if(hilfe != null) hilfe.indentMore();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Rückt im Hilfefenster eine Ebene aus.
|
||||
* Ist für die Verwendung im Algorithmus gedacht.
|
||||
*/
|
||||
public void infoIndentLess() {
|
||||
if(hilfe != null) hilfe.indentLess();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisiert den Graphen
|
||||
*/
|
||||
public void init() {
|
||||
gp.getGraphOptions().knotenKurztext = new String[]{"Wert"};
|
||||
gp.getGraphOptions().knotenLangtext = new String[]{"Infotext","Wert","Markiert","Besucht"};
|
||||
if(g.isGewichtet()) {
|
||||
gp.getGraphOptions().kanteKurztext = new String[]{"Gewicht"};
|
||||
gp.getGraphOptions().kanteLangtext = new String[]{"Gewicht","Markiert","Gelöscht"};
|
||||
} else {
|
||||
gp.getGraphOptions().kanteKurztext = new String[]{};
|
||||
gp.getGraphOptions().kanteLangtext = new String[]{"Markiert","Gelöscht"};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,15 +29,19 @@ public class GraphAlgo_BellmanFord extends GraphAlgo {
|
|||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
for(Knoten k : g.getAlleKnoten()) {
|
||||
k.setWert(Double.POSITIVE_INFINITY);
|
||||
}
|
||||
info("Setze alle Entfernungen auf unendlich");
|
||||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
for(Knoten k : g.getAlleKnoten()) {
|
||||
k.setWert(1000);
|
||||
}
|
||||
info("Setze alle Entfernungen auf unendlich (1000)");
|
||||
|
||||
getStartKnoten().setWert(0);
|
||||
info("Setze Startknoten auf Entfernung 0");
|
||||
step();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,13 @@ public class GraphAlgo_Dijkstra extends GraphAlgo {
|
|||
return "Kürzester Pfad (Dijkstra)";
|
||||
}
|
||||
|
||||
public void init() {
|
||||
super.init();
|
||||
for(Knoten k : g.getAlleKnoten()) {
|
||||
k.setWert(Double.POSITIVE_INFINITY);
|
||||
}
|
||||
info("Setze alle Entfernungen auf unendlich");
|
||||
}
|
||||
// Anfang Methoden
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
|
|
@ -50,13 +57,10 @@ public class GraphAlgo_Dijkstra extends GraphAlgo {
|
|||
if(!n.isMarkiert()){
|
||||
info("- ist noch nicht markiert");
|
||||
Kante ka = g.getKante(k, n);
|
||||
if(!n.isBesucht() || n.getDoubleWert() > k.getDoubleWert()+ka.getGewicht()){
|
||||
if(n.getDoubleWert() > k.getDoubleWert()+ka.getGewicht()){
|
||||
if(n.isBesucht()) {
|
||||
List<Kante> eingehend = g.getEingehendeKanten(n, ka2 -> !ka2.isGeloescht() && ka2.isMarkiert());
|
||||
Kante alterWeg = eingehend.get(0);
|
||||
// Kante alterWeg = g.beschraenkeKantenAuf(g.getEingehendeKanten(n), Graph.MARKIERT, Graph.NICHTGELOESCHT).get(0);
|
||||
// alterWeg.setGeloescht(true);
|
||||
// alterWeg.setMarkiert(false);
|
||||
alterWeg.setGeloescht(true);
|
||||
alterWeg.setMarkiert(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
package algorithmen;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.nio.file.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
import graph.*;
|
||||
/**
|
||||
* Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
|
||||
* Algorithmus: Dijkstra
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
public class GraphAlgo_DijkstraMitVorgaenger extends GraphAlgo {
|
||||
|
||||
// Anfang Attribute
|
||||
public String getBezeichnung() {
|
||||
return "Kürzester Pfad (Dijkstra mit Vorgänger)";
|
||||
}
|
||||
|
||||
|
||||
public void init() {
|
||||
List<Knoten> alle = g.getAlleKnoten();
|
||||
for(Knoten k : alle) {
|
||||
k.set("Vorgänger","-");
|
||||
k.set("Entfernung",Double.POSITIVE_INFINITY);
|
||||
k.setSortierkriterium("Entfernung");
|
||||
}
|
||||
gp.getGraphOptions().knotenKurztext = new String[]{"Entfernung","Vorgänger"};
|
||||
gp.getGraphOptions().knotenLangtext = new String[]{"Infotext","Entfernung","Vorgänger","Markiert","Besucht"};
|
||||
}
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
info("Erzeuge leere toDo-Liste und füge Startknoten hinzu");
|
||||
List<Knoten> toDo = new ArrayList<Knoten>();
|
||||
getStartKnoten().setBesucht(true);
|
||||
getStartKnoten().set("Entfernung", 0);
|
||||
toDo.add(getStartKnoten());
|
||||
|
||||
while(toDo.size()>0) {
|
||||
info("Sortiere toDo-Liste nach der Entfernung");
|
||||
Collections.sort(toDo);
|
||||
info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus");
|
||||
Knoten k = toDo.remove(0);
|
||||
infoIndentMore();
|
||||
k.setMarkiert(true);
|
||||
info("Markiere den Knoten");
|
||||
info("Er hat Entfernung "+k.getString("Entfernung"));
|
||||
info("Für jeden Nachbarknoten");
|
||||
infoIndentMore();
|
||||
for(Knoten n : g.getNachbarknoten(k)) {
|
||||
if(!n.isMarkiert()){
|
||||
if(!n.getInfotext().isEmpty()) {
|
||||
info("- "+n.getInfotext()+" ist noch nicht markiert");
|
||||
} else {
|
||||
info("- Knoten Nr. "+g.getNummer(n)+" ist noch nicht markiert");
|
||||
}
|
||||
Kante ka = g.getKante(k, n);
|
||||
if(!n.isBesucht() || n.getDouble("Entfernung") > k.getDouble("Entfernung") + ka.getGewicht()){
|
||||
if(n.isBesucht()) {
|
||||
List<Kante> eingehend = g.getEingehendeKanten(n, ka2 -> !ka2.isGeloescht() && ka2.isMarkiert());
|
||||
Kante alterWeg = eingehend.get(0);
|
||||
// Kante alterWeg = g.beschraenkeKantenAuf(g.getEingehendeKanten(n), Graph.MARKIERT, Graph.NICHTGELOESCHT).get(0);
|
||||
// alterWeg.setGeloescht(true);
|
||||
// alterWeg.setMarkiert(false);
|
||||
alterWeg.setGeloescht(true);
|
||||
alterWeg.setMarkiert(false);
|
||||
|
||||
info(" loesche bisherigen Weg dorthin");
|
||||
}
|
||||
|
||||
n.set("Entfernung", k.getInt("Entfernung")+ka.getGewicht());
|
||||
if(k.getInfotext().equals("")) {
|
||||
n.set("Vorgänger",g.getNummer(k));
|
||||
} else {
|
||||
n.set("Vorgänger",k.getInfotext());
|
||||
}
|
||||
if(!toDo.contains(n)) toDo.add(n);
|
||||
ka.setMarkiert(true);
|
||||
n.setBesucht(true);
|
||||
info(" setze Entfernung "+n.getString("Entfernung")+" und füge ggf. ToDo-Liste hinzu.");
|
||||
info(" toDo-Liste hat jetzt "+toDo.size()+" Elemente");
|
||||
} else {
|
||||
info(" keine neue beste Entfernung");
|
||||
ka.setGeloescht(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
infoIndentLess();
|
||||
infoIndentLess();
|
||||
step();
|
||||
}
|
||||
info("ToDo-Liste fertig abgearbeitet");
|
||||
|
||||
} // end
|
||||
// Ende Methoden
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -43,26 +43,28 @@ public class GraphAlgo_toplogischeSortierung extends GraphAlgo {
|
|||
info("Sortiere die noch nicht markierten Knoten nach ihrem Wert");
|
||||
Knoten k = knoten.get(0);
|
||||
k.setMarkiert(true);
|
||||
info("Nimm Knoten "+g.getKnoteninfo(k,false)+" und markiere ihn.");
|
||||
info("Nimm Knoten mit dem geringsten Wert: "+g.getKnoteninfo(k,false)+" und markiere ihn.");
|
||||
|
||||
if(k.getIntWert() != 0) {
|
||||
melde("Fehler: Wert ist nicht 0 - Zyklus vorhanden");
|
||||
melde("Fehler: Wert ist nicht 0 - Zyklus vorhanden - Keine topologische Sortierung möglich");
|
||||
knoten.clear();
|
||||
return;
|
||||
} else {
|
||||
reihenfolge += " "+g.getKnoteninfo(k, false);
|
||||
info("Füge ihn der Liste hinzu: "+reihenfolge);
|
||||
knoten.remove(k);
|
||||
info("Reduziere den Wert aller Nachbarn von "+g.getKnoteninfo(k,false)+" um 1");
|
||||
infoIndentMore();
|
||||
for(Knoten k2 : g.getNachbarknoten(k)) {
|
||||
k2.setWert(k2.getIntWert()-1);
|
||||
info("Setze "+g.getKnoteninfo(k2, false)+" auf "+k2.getIntWert());
|
||||
}
|
||||
info("Reduziere den Wert aller Nachbarn von Knoten "+g.getNummer(k)+" um 1");
|
||||
infoIndentLess();
|
||||
}
|
||||
step();
|
||||
}
|
||||
melde("Topologische Sortierung: "+reihenfolge);
|
||||
|
||||
|
||||
} // end
|
||||
|
||||
// Ende Methoden
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
#BlueJ package file
|
||||
dependency1.from=GraphAlgo_DominatingSetGreedyE
|
||||
dependency1.from=GraphAlgo_DominatingSetGreedyF
|
||||
dependency1.to=GraphAlgo
|
||||
dependency1.type=UsesDependency
|
||||
dependency2.from=GraphAlgo_DominatingSetGreedyE
|
||||
dependency2.from=GraphAlgo_DominatingSetGreedyF
|
||||
dependency2.to=GraphAlgo_Moore
|
||||
dependency2.type=UsesDependency
|
||||
dependency3.from=GraphAlgo_DominatingSetGreedyF
|
||||
dependency3.from=GraphAlgo_DominatingSetGreedyG
|
||||
dependency3.to=GraphAlgo
|
||||
dependency3.type=UsesDependency
|
||||
dependency4.from=GraphAlgo_DominatingSetGreedyF
|
||||
dependency4.from=GraphAlgo_DominatingSetGreedyG
|
||||
dependency4.to=GraphAlgo_Moore
|
||||
dependency4.type=UsesDependency
|
||||
dependency5.from=GraphAlgo_DominatingSetGreedyG
|
||||
dependency5.from=GraphAlgo_DominatingSetGreedyE
|
||||
dependency5.to=GraphAlgo
|
||||
dependency5.type=UsesDependency
|
||||
dependency6.from=GraphAlgo_DominatingSetGreedyG
|
||||
dependency6.from=GraphAlgo_DominatingSetGreedyE
|
||||
dependency6.to=GraphAlgo_Moore
|
||||
dependency6.type=UsesDependency
|
||||
dependency7.from=GraphAlgo_DominatingSetGreedyH
|
||||
|
|
@ -23,18 +23,18 @@ dependency7.type=UsesDependency
|
|||
dependency8.from=GraphAlgo_DominatingSetGreedyH
|
||||
dependency8.to=GraphAlgo_Moore
|
||||
dependency8.type=UsesDependency
|
||||
objectbench.height=133
|
||||
objectbench.width=750
|
||||
objectbench.height=66
|
||||
objectbench.width=1428
|
||||
package.divider.horizontal=0.6003172085646312
|
||||
package.divider.vertical=0.8309178743961353
|
||||
package.editor.height=668
|
||||
package.editor.width=1133
|
||||
package.editor.x=533
|
||||
package.editor.y=122
|
||||
package.frame.height=928
|
||||
package.frame.width=1297
|
||||
package.divider.vertical=0.9027962716378163
|
||||
package.editor.height=671
|
||||
package.editor.width=1292
|
||||
package.editor.x=100
|
||||
package.editor.y=118
|
||||
package.frame.height=852
|
||||
package.frame.width=1452
|
||||
package.numDependencies=8
|
||||
package.numTargets=31
|
||||
package.numTargets=32
|
||||
package.showExtends=true
|
||||
package.showUses=true
|
||||
readme.height=60
|
||||
|
|
@ -46,216 +46,223 @@ target1.height=50
|
|||
target1.name=GraphAlgo_ColoringGreedyRandom
|
||||
target1.showInterface=false
|
||||
target1.type=ClassTarget
|
||||
target1.width=250
|
||||
target1.x=600
|
||||
target1.width=290
|
||||
target1.x=740
|
||||
target1.y=590
|
||||
target10.height=50
|
||||
target10.name=GraphAlgo_DominatingSetGreedyF
|
||||
target10.showInterface=false
|
||||
target10.type=ClassTarget
|
||||
target10.width=240
|
||||
target10.x=290
|
||||
target10.width=280
|
||||
target10.x=430
|
||||
target10.y=420
|
||||
target11.height=50
|
||||
target11.name=GraphAlgo_DominatingSetGreedyG
|
||||
target11.showInterface=false
|
||||
target11.type=ClassTarget
|
||||
target11.width=250
|
||||
target11.x=290
|
||||
target11.width=290
|
||||
target11.x=430
|
||||
target11.y=470
|
||||
target12.height=50
|
||||
target12.name=GraphAlgo_TSPGreedy
|
||||
target12.showInterface=false
|
||||
target12.type=ClassTarget
|
||||
target12.width=230
|
||||
target12.x=600
|
||||
target12.x=740
|
||||
target12.y=160
|
||||
target13.height=50
|
||||
target13.name=GraphAlgo_DominatingSetGreedyD
|
||||
target13.showInterface=false
|
||||
target13.type=ClassTarget
|
||||
target13.width=250
|
||||
target13.x=290
|
||||
target13.width=290
|
||||
target13.x=430
|
||||
target13.y=320
|
||||
target14.height=50
|
||||
target14.name=GraphAlgo_TSPGenetisch
|
||||
target14.showInterface=false
|
||||
target14.type=ClassTarget
|
||||
target14.width=230
|
||||
target14.x=600
|
||||
target14.x=740
|
||||
target14.y=340
|
||||
target15.height=50
|
||||
target15.name=GraphAlgo_DominatingSetGreedyE
|
||||
target15.showInterface=false
|
||||
target15.type=ClassTarget
|
||||
target15.width=240
|
||||
target15.x=290
|
||||
target15.width=280
|
||||
target15.x=430
|
||||
target15.y=370
|
||||
target16.height=50
|
||||
target16.name=GraphAlgo_DominatingSetGenetisch
|
||||
target16.showInterface=false
|
||||
target16.type=ClassTarget
|
||||
target16.width=250
|
||||
target16.x=290
|
||||
target16.width=300
|
||||
target16.x=430
|
||||
target16.y=640
|
||||
target17.height=50
|
||||
target17.name=GraphAlgo_ZyklusBacktracking
|
||||
target17.showInterface=false
|
||||
target17.type=ClassTarget
|
||||
target17.width=220
|
||||
target17.x=20
|
||||
target17.y=640
|
||||
target17.width=230
|
||||
target17.x=160
|
||||
target17.y=410
|
||||
target18.height=50
|
||||
target18.name=GraphAlgo_DominatingSetGreedyH
|
||||
target18.showInterface=false
|
||||
target18.type=ClassTarget
|
||||
target18.width=250
|
||||
target18.x=290
|
||||
target18.width=290
|
||||
target18.x=430
|
||||
target18.y=520
|
||||
target19.height=50
|
||||
target19.name=GraphAlgo_DominatingSetGreedyI
|
||||
target19.showInterface=false
|
||||
target19.type=ClassTarget
|
||||
target19.width=240
|
||||
target19.x=290
|
||||
target19.width=280
|
||||
target19.x=430
|
||||
target19.y=570
|
||||
target2.height=50
|
||||
target2.name=GraphAlgo_Tiefensuche
|
||||
target2.showInterface=false
|
||||
target2.type=ClassTarget
|
||||
target2.width=210
|
||||
target2.x=20
|
||||
target2.y=170
|
||||
target2.x=160
|
||||
target2.y=160
|
||||
target20.height=50
|
||||
target20.name=GraphAlgo_Moore
|
||||
target20.showInterface=false
|
||||
target20.type=ClassTarget
|
||||
target20.width=210
|
||||
target20.x=20
|
||||
target20.y=440
|
||||
target20.x=150
|
||||
target20.y=480
|
||||
target21.height=50
|
||||
target21.name=GraphAlgo_BellmanFord
|
||||
target21.showInterface=false
|
||||
target21.type=ClassTarget
|
||||
target21.width=210
|
||||
target21.x=20
|
||||
target21.y=560
|
||||
target21.x=150
|
||||
target21.y=660
|
||||
target22.height=50
|
||||
target22.name=GraphAlgo_Breitensuche
|
||||
target22.showInterface=false
|
||||
target22.type=ClassTarget
|
||||
target22.width=210
|
||||
target22.x=20
|
||||
target22.y=290
|
||||
target22.x=160
|
||||
target22.y=280
|
||||
target23.height=50
|
||||
target23.name=GraphAlgo_toplogischeSortierung
|
||||
target23.showInterface=false
|
||||
target23.type=ClassTarget
|
||||
target23.width=240
|
||||
target23.x=20
|
||||
target23.y=370
|
||||
target23.width=250
|
||||
target23.x=160
|
||||
target23.y=350
|
||||
target24.height=50
|
||||
target24.name=GraphAlgo_DominatingSetBacktracking
|
||||
target24.showInterface=false
|
||||
target24.type=ClassTarget
|
||||
target24.width=270
|
||||
target24.x=290
|
||||
target24.width=320
|
||||
target24.x=430
|
||||
target24.y=100
|
||||
target25.height=50
|
||||
target25.name=GraphAlgo_ColoringGreedy
|
||||
target25.showInterface=false
|
||||
target25.type=ClassTarget
|
||||
target25.width=240
|
||||
target25.x=600
|
||||
target25.x=740
|
||||
target25.y=530
|
||||
target26.height=50
|
||||
target26.name=GraphAlgo_EulerkreisExistenz
|
||||
target26.name=GraphAlgo_DijkstraMitVorgaenger
|
||||
target26.showInterface=false
|
||||
target26.type=ClassTarget
|
||||
target26.width=210
|
||||
target26.x=20
|
||||
target26.y=100
|
||||
target26.width=250
|
||||
target26.x=150
|
||||
target26.y=600
|
||||
target27.height=50
|
||||
target27.name=GraphAlgo_TiefensucheRek
|
||||
target27.name=GraphAlgo_EulerkreisExistenz
|
||||
target27.showInterface=false
|
||||
target27.type=ClassTarget
|
||||
target27.width=210
|
||||
target27.x=20
|
||||
target27.y=230
|
||||
target27.width=220
|
||||
target27.x=160
|
||||
target27.y=100
|
||||
target28.height=50
|
||||
target28.name=GraphAlgo_TSPGreedy2
|
||||
target28.name=GraphAlgo_TiefensucheRek
|
||||
target28.showInterface=false
|
||||
target28.type=ClassTarget
|
||||
target28.width=230
|
||||
target28.x=600
|
||||
target28.width=210
|
||||
target28.x=160
|
||||
target28.y=220
|
||||
target29.height=50
|
||||
target29.name=GraphAlgo_ColoringBacktracking
|
||||
target29.name=GraphAlgo_TSPGreedy2
|
||||
target29.showInterface=false
|
||||
target29.type=ClassTarget
|
||||
target29.width=240
|
||||
target29.x=600
|
||||
target29.y=470
|
||||
target29.width=230
|
||||
target29.x=740
|
||||
target29.y=220
|
||||
target3.height=50
|
||||
target3.name=GraphAlgo_MST_Prim
|
||||
target3.name=GraphAlgo_TSPBacktracking
|
||||
target3.showInterface=false
|
||||
target3.type=ClassTarget
|
||||
target3.width=230
|
||||
target3.x=890
|
||||
target3.width=240
|
||||
target3.x=740
|
||||
target3.y=100
|
||||
target30.height=50
|
||||
target30.name=GraphAlgo_Dijkstra
|
||||
target30.name=GraphAlgo_ColoringBacktracking
|
||||
target30.showInterface=false
|
||||
target30.type=ClassTarget
|
||||
target30.width=210
|
||||
target30.x=20
|
||||
target30.y=500
|
||||
target30.width=270
|
||||
target30.x=740
|
||||
target30.y=470
|
||||
target31.height=50
|
||||
target31.name=GraphAlgo_TSPGreedyOpt
|
||||
target31.name=GraphAlgo_Dijkstra
|
||||
target31.showInterface=false
|
||||
target31.type=ClassTarget
|
||||
target31.width=230
|
||||
target31.x=600
|
||||
target31.y=280
|
||||
target31.width=210
|
||||
target31.x=150
|
||||
target31.y=540
|
||||
target32.height=50
|
||||
target32.name=GraphAlgo_TSPGreedyOpt
|
||||
target32.showInterface=false
|
||||
target32.type=ClassTarget
|
||||
target32.width=230
|
||||
target32.x=740
|
||||
target32.y=280
|
||||
target4.height=50
|
||||
target4.name=GraphAlgo_TSPBacktracking
|
||||
target4.name=GraphAlgo_MST_Prim
|
||||
target4.showInterface=false
|
||||
target4.type=ClassTarget
|
||||
target4.width=230
|
||||
target4.x=600
|
||||
target4.x=1030
|
||||
target4.y=100
|
||||
target5.height=50
|
||||
target5.name=GraphAlgo_DominatingSetGreedyB
|
||||
target5.showInterface=false
|
||||
target5.type=ClassTarget
|
||||
target5.width=240
|
||||
target5.x=290
|
||||
target5.width=290
|
||||
target5.x=430
|
||||
target5.y=220
|
||||
target6.height=50
|
||||
target6.name=GraphAlgo
|
||||
target6.showInterface=false
|
||||
target6.type=AbstractTarget
|
||||
target6.width=90
|
||||
target6.x=310
|
||||
target6.width=100
|
||||
target6.x=450
|
||||
target6.y=10
|
||||
target7.height=50
|
||||
target7.name=GraphAlgo_DominatingSetGreedyC
|
||||
target7.showInterface=false
|
||||
target7.type=ClassTarget
|
||||
target7.width=240
|
||||
target7.x=290
|
||||
target7.width=290
|
||||
target7.x=430
|
||||
target7.y=270
|
||||
target8.height=50
|
||||
target8.name=GraphAlgo_MST_Kruskal
|
||||
target8.showInterface=false
|
||||
target8.type=ClassTarget
|
||||
target8.width=230
|
||||
target8.x=890
|
||||
target8.x=1030
|
||||
target8.y=160
|
||||
target9.height=50
|
||||
target9.name=GraphAlgo_DominatingSetGreedyA
|
||||
target9.showInterface=false
|
||||
target9.type=ClassTarget
|
||||
target9.width=250
|
||||
target9.x=290
|
||||
target9.width=290
|
||||
target9.x=430
|
||||
target9.y=170
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ showWeights,0
|
|||
# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0
|
||||
showInfoText,1
|
||||
# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2
|
||||
vertexStyle,2
|
||||
vertexStyle,1
|
||||
# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben!
|
||||
image,siedler.png
|
||||
#
|
||||
|
|
@ -16,12 +16,12 @@ directed,1
|
|||
# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht.
|
||||
list,infotext
|
||||
Farm,285,101,1,3
|
||||
Mühle,531,105,2
|
||||
Bäckerei,694,159
|
||||
Mühle,531,105,2
|
||||
Bäckerei,694,159
|
||||
Schweinefarm,119,239,4
|
||||
Metzger,167,409
|
||||
Kohlemine,423,445,7,8
|
||||
Erzmine,724,314,7
|
||||
Eisenschmelze,537,326,8
|
||||
Werkzeugmacher,389,246,0,4
|
||||
Fischerhütte,741,456,6,5
|
||||
Fischerhütte,741,456,6,5
|
||||
|
Can't render this file because it contains an unexpected character in line 7 and column 33.
|
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 550 KiB |
|
|
@ -14,7 +14,7 @@ import javafx.application.Platform;
|
|||
* Abstrakte Oberklasse für alle zu simulierende Algorithmen
|
||||
* Diese müssen die Methode getBezeichnung(): String und fuehreAlgorithmusAus() überschreiben.
|
||||
*
|
||||
* @version 6.7 (Dez. 2020)
|
||||
* @version 7.1 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -78,10 +78,9 @@ public abstract class GraphAlgo extends Thread {
|
|||
/**
|
||||
* Muss vom Algorithmus aufgerufen werden, um einen Haltepunkt zu setzen
|
||||
*/
|
||||
public void step() {
|
||||
public void step() throws InterruptedException {
|
||||
if(gp == null) return;
|
||||
try{
|
||||
//System.out.println("Step");
|
||||
gp.updateImage();
|
||||
aktuellerZustand = g.getStatus();
|
||||
waitforclick = true;
|
||||
|
|
@ -95,9 +94,13 @@ public abstract class GraphAlgo extends Thread {
|
|||
if (hilfe != null) hilfe.setReviewAllowed(false);
|
||||
g.setStatus(aktuellerZustand);
|
||||
aktuellerZustand = null;
|
||||
if(Thread.interrupted()){
|
||||
throw new InterruptedException();
|
||||
}
|
||||
}catch(Exception e) {
|
||||
// Erneutes Stop, damit nicht stop während des Sleeps hier abgefangen wird.
|
||||
stop();
|
||||
//System.out.println("Step wurde unterbrochen");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -146,17 +149,13 @@ public abstract class GraphAlgo extends Thread {
|
|||
if (hilfe != null) hilfe.setReviewAllowed(false);
|
||||
fuehreAlgorithmusAus();
|
||||
gp.updateImage();
|
||||
// System.out.println("Algorithmus beendet");
|
||||
} catch( ThreadDeath e){
|
||||
// System.out.println("Algorithmus vorzeitig beendet."+e);
|
||||
//System.out.println("Algorithmus beendet");
|
||||
} catch( InterruptedException e){
|
||||
//System.out.println("Algorithmus vorzeitig beendet."+e);
|
||||
} finally {
|
||||
if (hilfe != null) hilfe.setReviewAllowed(true);
|
||||
inArbeit = false;
|
||||
}
|
||||
if (hilfe != null) hilfe.setReviewAllowed(true);
|
||||
inArbeit = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Ende Methoden
|
||||
|
|
@ -184,7 +183,7 @@ public abstract class GraphAlgo extends Thread {
|
|||
/**
|
||||
* Methode für den eigentlichen Algorithmus
|
||||
*/
|
||||
public abstract void fuehreAlgorithmusAus();
|
||||
public abstract void fuehreAlgorithmusAus() throws InterruptedException;
|
||||
|
||||
/**
|
||||
* Name des Algorithmus für die Dropdown-Auswahl
|
||||
|
|
@ -257,3 +256,4 @@ public abstract class GraphAlgo extends Thread {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import graph.*;
|
|||
* Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
|
||||
* Algorithmus: Bellman-Ford
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ public class GraphAlgo_BellmanFord extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* Dieser Algorithmus nummeriert alle Knoten des Graphen.
|
||||
* Algorithmus: Breitensuche mit ToDo-Liste (Schlange)
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ public class GraphAlgo_Breitensuche extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
|
||||
* Algorithmus: Backtracking
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ public class GraphAlgo_ColoringBacktracking extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ public class GraphAlgo_ColoringBacktracking extends GraphAlgo {
|
|||
step();
|
||||
}
|
||||
|
||||
private void bestimmeColoring(int benutzteFarben) {
|
||||
private void bestimmeColoring(int benutzteFarben) throws InterruptedException {
|
||||
int min = Integer.MAX_VALUE;
|
||||
|
||||
List<Knoten> knoten = g.getAlleKnoten(k->k.getFarbe()<=0);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import graph.*;
|
|||
* die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
|
||||
* Algorithmus: Näherungslösung mit Greedy-Algorithmus
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
public class GraphAlgo_ColoringGreedy extends GraphAlgo {
|
||||
|
|
@ -26,7 +26,7 @@ public class GraphAlgo_ColoringGreedy extends GraphAlgo {
|
|||
// Ende Attribute
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
List<Knoten> knoten = g.getAlleKnoten();
|
||||
info("Wiederhole für jeden Knoten");
|
||||
for (Knoten aktuellerKnoten: knoten ) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
|
||||
* Algorithmus: Näherungslösung mit Greedy-Algorithmus (Knotenreihenfolge zufällig)
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ public class GraphAlgo_ColoringGreedyRandom extends GraphAlgo {
|
|||
// Ende Attribute
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
List<Knoten> knoten = g.getAlleKnoten();
|
||||
Collections.shuffle(knoten);
|
||||
info("Wiederhole für jeden Knoten");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
|
||||
* Algorithmus: Dijkstra
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ public class GraphAlgo_Dijkstra extends GraphAlgo {
|
|||
}
|
||||
// Anfang Methoden
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import graph.*;
|
|||
* Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
|
||||
* Algorithmus: Dijkstra
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ public class GraphAlgo_DijkstraMitVorgaenger extends GraphAlgo {
|
|||
gp.getGraphOptions().knotenLangtext = new String[]{"Infotext","Entfernung","Vorgänger","Markiert","Besucht"};
|
||||
}
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* und bestimmt den Zeitbedarf.
|
||||
* Algorithmus: Backtracking
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ public class GraphAlgo_DominatingSetBacktracking extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
long starttime = System.currentTimeMillis();
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
|
|
@ -41,7 +41,7 @@ public class GraphAlgo_DominatingSetBacktracking extends GraphAlgo {
|
|||
|
||||
|
||||
|
||||
private void bestimmeDominierendeMenge(int knoten) {
|
||||
private void bestimmeDominierendeMenge(int knoten) throws InterruptedException {
|
||||
List<String> status = g.getStatus();
|
||||
|
||||
List<Knoten> markierte = g.getAlleKnoten(kn->kn.isMarkiert());
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import graph.*;
|
|||
* Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen
|
||||
* und bestimmt den Zeitbedarf.
|
||||
* Algorithmus: Genetischer Algorithmus
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ public class GraphAlgo_DominatingSetGenetisch extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
population = new int[popGroesse][g.getAnzahlKnoten()];
|
||||
double[] bewertungen = new double[popGroesse];
|
||||
for(int i=0; i<popGroesse; i++) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* Nimm den Knoten mit den meisten Nachbarn
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ public class GraphAlgo_DominatingSetGreedyA extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import graph.*;
|
|||
* und bestimmt den Zeitbedarf.
|
||||
* Algorithmus: Greedy mit Strategie:
|
||||
* Nimm den Knoten mit den wenigsten Nachbarn
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ public class GraphAlgo_DominatingSetGreedyB extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* Nimm den Knoten mit den meisten Nachbarn
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ public class GraphAlgo_DominatingSetGreedyC extends GraphAlgo {
|
|||
/** Bestimmt besten Knoten nach Strategie:
|
||||
* Nimm den Knoten mit den meisten Nachbarn
|
||||
*/
|
||||
private Knoten bestimmeBesten() {
|
||||
private Knoten bestimmeBesten() {
|
||||
List<Knoten> knoten = g.getAlleKnoten(k->!k.isMarkiert());
|
||||
|
||||
info("Wiederhole für jeden noch nicht markierten Knoten");
|
||||
|
|
@ -49,7 +49,7 @@ public class GraphAlgo_DominatingSetGreedyC extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* Nimm den Knoten mit den meisten Nachbarn
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ public class GraphAlgo_DominatingSetGreedyD extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ public class GraphAlgo_DominatingSetGreedyE extends GraphAlgo {
|
|||
* ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*/
|
||||
|
||||
private Knoten bestimmeBesten() {
|
||||
private Knoten bestimmeBesten() throws InterruptedException {
|
||||
Random r= new Random();
|
||||
|
||||
List<Knoten> markierte = g.getAlleKnoten(k->k.isMarkiert() );
|
||||
|
|
@ -68,7 +68,7 @@ public class GraphAlgo_DominatingSetGreedyE extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ public class GraphAlgo_DominatingSetGreedyF extends GraphAlgo {
|
|||
* ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*/
|
||||
|
||||
private Knoten bestimmeBesten() {
|
||||
private Knoten bestimmeBesten() throws InterruptedException {
|
||||
Random r= new Random();
|
||||
|
||||
List<Knoten> markierte = g.getAlleKnoten(k->k.isMarkiert() );
|
||||
|
|
@ -68,7 +68,7 @@ public class GraphAlgo_DominatingSetGreedyF extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ public class GraphAlgo_DominatingSetGreedyG extends GraphAlgo {
|
|||
* ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*/
|
||||
|
||||
private Knoten bestimmeBesten() {
|
||||
private Knoten bestimmeBesten() throws InterruptedException {
|
||||
Random r= new Random();
|
||||
|
||||
List<Knoten> markierte = g.getAlleKnoten(k->k.isMarkiert() );
|
||||
|
|
@ -68,7 +68,7 @@ public class GraphAlgo_DominatingSetGreedyG extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* ein nicht abgedeckten Knoten, der von möglichst vielen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ public class GraphAlgo_DominatingSetGreedyH extends GraphAlgo {
|
|||
/** Bestimmt besten Knoten nach Strategie:
|
||||
* ein nicht abgedeckten Knoten, der von möglichst vielen schon ausgewählten Knoten die Entfernung 3 hat
|
||||
*/
|
||||
private Knoten bestimmeBesten() {
|
||||
private Knoten bestimmeBesten() throws InterruptedException {
|
||||
Random r = new Random();
|
||||
List<Knoten> markierte = g.getAlleKnoten(k->k.isMarkiert() );
|
||||
List<Knoten> nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht() );
|
||||
|
|
@ -71,7 +71,7 @@ public class GraphAlgo_DominatingSetGreedyH extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import graph.*;
|
|||
* Algorithmus: Greedy mit Strategie:
|
||||
* ein nicht abgedeckten Knoten, der von den ausgewählten Knoten eine möglichst große Entfernung hat
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ public class GraphAlgo_DominatingSetGreedyI extends GraphAlgo {
|
|||
* ein nicht abgedeckten Knoten, der von den ausgewählten Knoten eine möglichst große Entfernung hat
|
||||
*/
|
||||
|
||||
private Knoten bestimmeBesten() {
|
||||
private Knoten bestimmeBesten() throws InterruptedException {
|
||||
Random r = new Random();
|
||||
List<Knoten> markierte = g.getAlleKnoten(k->k.isMarkiert() );
|
||||
List<Knoten> nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht() );
|
||||
|
|
@ -84,7 +84,7 @@ public class GraphAlgo_DominatingSetGreedyI extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import graph.*;
|
|||
* Algorithmus: Zunächst wird auf geraden Grad der Knoten getestet, danach
|
||||
* mit Tiefensuche der Zusammenhang des Graphen überprüft.
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ public class GraphAlgo_EulerkreisExistenz extends GraphAlgo {
|
|||
return "Eulerkreis (Existenz)";
|
||||
}
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class GraphAlgo_MST_Kruskal extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
int farbe = 1;
|
||||
List<Kante> kanten = g.getAlleKanten();
|
||||
List<Knoten> knoten = g.getAlleKnoten();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class GraphAlgo_MST_Prim extends GraphAlgo {
|
|||
return "MST (Prim)";
|
||||
}
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
int markiert = 0;
|
||||
List<Knoten> knoten;
|
||||
List<Kante> kanten;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen.
|
||||
* Algorithmus: Algorithmus A von Moore
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ public class GraphAlgo_Moore extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class GraphAlgo_TSPBacktracking extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
start = this.getStartKnoten();
|
||||
probiere(start);
|
||||
g.setStatus(besteLoesung);
|
||||
|
|
@ -40,7 +40,7 @@ public class GraphAlgo_TSPBacktracking extends GraphAlgo {
|
|||
melde("beste Route gefunden:" +getInfo());
|
||||
} // end of for
|
||||
|
||||
public void probiere(Knoten akt) {
|
||||
public void probiere(Knoten akt) throws InterruptedException {
|
||||
boolean fertig = true;
|
||||
infoIndentMore();
|
||||
akt.setMarkiert(true);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class GraphAlgo_TSPGenetisch extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
population = new int[popGroesse][g.getAnzahlKnoten()+1];
|
||||
double[] rundreiseLaenge = new double[popGroesse];
|
||||
for(int i=0; i<popGroesse; i++) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class GraphAlgo_TSPGreedy extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
Knoten start = this.getStartKnoten();
|
||||
Knoten akt = start;
|
||||
Kante min;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class GraphAlgo_TSPGreedy2 extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
int farbe = 1;
|
||||
int anzkanten = 0;
|
||||
List<Kante> kanten = g.getAlleKanten();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class GraphAlgo_TSPGreedyOpt extends GraphAlgo {
|
|||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
Knoten start = this.getStartKnoten();
|
||||
Knoten akt = start;
|
||||
List<Knoten> reihung = new ArrayList<Knoten>();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* Dieser Algorithmus nummeriert alle Knoten des Graphen.
|
||||
* Algorithmus: Tiefensuche mit ToDo-Liste (Stapel)
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ public class GraphAlgo_Tiefensuche extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* Dieser Algorithmus nummeriert alle Knoten des Graphen.
|
||||
* Algorithmus: Tiefensuche rekursiv
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -24,14 +24,14 @@ public class GraphAlgo_TiefensucheRek extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
}
|
||||
nummeriere(getStartKnoten(), 0);
|
||||
} // end
|
||||
|
||||
private int nummeriere(Knoten k, int nr) {
|
||||
private int nummeriere(Knoten k, int nr) throws InterruptedException {
|
||||
// Abbruchbedingung
|
||||
if(k.isBesucht()) {
|
||||
info("Untersuche "+g.getKnoteninfo(k,false)+" => ist schon besucht");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import graph.*;
|
|||
* Er sucht einen Zyklus im Graphen.
|
||||
* Algorithmus: Backtracking
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -22,13 +22,13 @@ public class GraphAlgo_ZyklusBacktracking extends GraphAlgo {
|
|||
return "Zyklensuche (Backtracking)";
|
||||
}
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
List<String> loesung = backtracking(getStartKnoten());
|
||||
if(loesung != null) g.setStatus(loesung);
|
||||
step();
|
||||
}
|
||||
|
||||
public List<String> backtracking(Knoten k){
|
||||
public List<String> backtracking(Knoten k) throws InterruptedException {
|
||||
|
||||
List<String> loesung = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import graph.*;
|
|||
/**
|
||||
* Dieser Algorithmus findet eine topologische Sortierung des Graphen.
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ public class GraphAlgo_toplogischeSortierung extends GraphAlgo {
|
|||
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
String reihenfolge = "";
|
||||
if (g.getAnzahlKnoten()==0) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0
|
||||
showWeights,0
|
||||
showWeights,1
|
||||
# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0
|
||||
showInfoText,1
|
||||
# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2
|
||||
|
|
|
|||
|
Can't render this file because it contains an unexpected character in line 7 and column 33.
|
|
|
@ -1,5 +1,5 @@
|
|||
# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0
|
||||
showWeights,0
|
||||
showWeights,1
|
||||
# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0
|
||||
showInfoText,1
|
||||
# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2
|
||||
|
|
|
|||
|
Can't render this file because it contains an unexpected character in line 7 and column 33.
|
|
|
@ -32,13 +32,14 @@ import javafx.collections.ObservableList;
|
|||
* Die Klasse Controller stellt den Controller des Hauptfensters / Menu dar.
|
||||
*
|
||||
* @author Thomas Schaller
|
||||
* @version 03.03.2023 (v7.1)
|
||||
* @version 12.02.2025 (v7.4)
|
||||
* v7.0: Die aktuelle Bildschirmposition und der angezeigte Graph werden in config.csv abgelegt.
|
||||
* v7.1: Verzeichnisauswahl für Laden/Speichern verbessert
|
||||
* v7.4: Unterbrechen von Simulieren-Thread neu geregelt.
|
||||
*/
|
||||
|
||||
public class Controller {
|
||||
private String version = "7.0 (Februar 2023)";
|
||||
private String version = "7.4 (Januar 2025)";
|
||||
private String pfad; // Pfad der aktuell angezeigten Datei
|
||||
|
||||
@FXML
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ import javafx.collections.ObservableList;
|
|||
* durchgeführt werden.
|
||||
*
|
||||
* @author Thomas Schaller
|
||||
* @version 03.03.2023 (v7.0)
|
||||
* @version 12.02.2025 (v7.4)
|
||||
* v7.4: Unterbrechen eines Algorithmus neu geregelt.
|
||||
* v7.1: Fehler bei Aktualisierung des Hilfefensters behoben, Splitpane statt HBox
|
||||
* v7.0: Mechanismus geändert, so dass die init-Methode des Algorithmus beim Wechesel eines Algorithmus
|
||||
* aufgerufen wird, um die für diesen Algorithmus passenden Anzeigeeinstellungen zu setzen.
|
||||
|
|
@ -189,7 +190,7 @@ public class SimulationTabMitController extends TabMitController implements Hilf
|
|||
}
|
||||
|
||||
public void changeAlgorithm() {
|
||||
if(aktAlgo != null && aktAlgo.isAlive()) aktAlgo.stop();
|
||||
if(aktAlgo != null && aktAlgo.isAlive() && !aktAlgo.isInterrupted()) aktAlgo.interrupt();
|
||||
graph.initialisiereAlleKnoten();
|
||||
graph.initialisiereAlleKanten();
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import algorithmen.*;
|
|||
* die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
|
||||
* Algorithmus: Beispieldatei, in der Schüler den Algorithmus selbst umsetzen können
|
||||
*
|
||||
* @version 1.0 from 10.12.2020
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Thomas Schaller
|
||||
*/
|
||||
|
||||
|
|
@ -28,9 +28,9 @@ public class GraphAlgo_Coloring_Schueler extends GraphAlgo {
|
|||
// Ende Attribute
|
||||
|
||||
// Anfang Methoden
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
gr = getGraph();
|
||||
getStartKnoten().setFarbe(3);
|
||||
getStartKnoten().setFarbe(3);
|
||||
|
||||
// Hole alle Knoten vom Graph g
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import algorithmen.*;
|
|||
/**
|
||||
* Beschreibung des Algos
|
||||
*
|
||||
* @version 1.0 from ???
|
||||
* @version 7.1 from 12.02.2025
|
||||
* @author Schueler
|
||||
*/
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ public class GraphAlgo_Dijkstra_Eigener extends GraphAlgo {
|
|||
return "02_Dijkstra_Eigener";
|
||||
}
|
||||
|
||||
public void fuehreAlgorithmusAus() {
|
||||
public void fuehreAlgorithmusAus() throws InterruptedException {
|
||||
gr = getGraph();
|
||||
//# Hier kommt dein Quelltext zum loesen des Graphenproblems hin:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue