master > master: code py - fügte tarjan im Hauptzyklus hinzu
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user