master > master: code py - fügte tarjan im Hauptzyklus hinzu

This commit is contained in:
RD
2022-06-10 16:05:15 +02:00
parent 3e8b3c157d
commit c0bc69450c
5 changed files with 53 additions and 30 deletions

View File

@@ -17,8 +17,8 @@ from models.generated.config import *;
from models.generated.commands import *;
from src.core.log import *;
from src.setup.config import *;
from src.models.graphs.graph import *;
from src.algorithms.tarjan.algorithms import *;
from src.models.graphs import *;
from src.algorithms.tarjan import *;
from src.algorithms.tsp import *;
from src.algorithms.hirschberg import *;
@@ -34,6 +34,14 @@ from src.algorithms.hirschberg import *;
def enter():
for command in COMMANDS:
if isinstance(command, CommandTarjan):
tarjan_algorithm(
G = Graph(
nodes=command.nodes,
edges=list(map(tuple, command.edges)),
),
verbose = OPTIONS.tarjan.verbose
);
if isinstance(command, CommandTsp):
tsp_algorithm(
dist = np.asarray(command.dist, dtype=float),
@@ -45,7 +53,7 @@ def enter():
X = command.word1,
Y = command.word2,
once = command.once,
verb = OPTIONS.hirschberg.verbose,
verbose = OPTIONS.hirschberg.verbose,
show = OPTIONS.hirschberg.show,
);
return;