2022-03-30 18:00:11 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# IMPORTS
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
import os;
|
|
|
|
import sys;
|
|
|
|
|
|
|
|
os.chdir(os.path.join(os.path.dirname(__file__), '..'));
|
|
|
|
sys.path.insert(0, os.getcwd());
|
|
|
|
|
2022-04-18 19:04:42 +02:00
|
|
|
from src.core.log import *;
|
2022-06-02 11:42:42 +02:00
|
|
|
from src.local.maths import *;
|
2022-04-07 16:41:33 +02:00
|
|
|
from src.graphs.graph import *;
|
|
|
|
from src.graphs.tarjan import *;
|
2022-06-02 11:42:42 +02:00
|
|
|
from src.travel.naive import *;
|
2022-06-09 01:51:08 +02:00
|
|
|
from src.string_alignment.hirschberg import *;
|
2022-04-07 16:41:33 +02:00
|
|
|
|
2022-03-30 18:00:11 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# GLOBAL CONSTANTS/VARIABLES
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# MAIN METHOD
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
def enter():
|
2022-06-09 01:51:08 +02:00
|
|
|
# ## Beispiel für Seminarwoche 9 (Blatt 8):
|
|
|
|
# tsp_naive_algorithm(
|
|
|
|
# dist = np.asarray([
|
|
|
|
# [0, 7, 4, 3],
|
|
|
|
# [7, 0, 5, 6],
|
|
|
|
# [2, 5, 0, 5],
|
|
|
|
# [2, 7, 4, 0],
|
|
|
|
# ], dtype=float),
|
|
|
|
# optimise=min,
|
|
|
|
# verbose=True,
|
|
|
|
# );
|
|
|
|
## Beispiel für Seminarwoche 10 (Blatt 9):
|
|
|
|
hirschberg_algorithm_full(
|
|
|
|
X = 'ACGAAG',
|
|
|
|
Y = 'AGAT',
|
|
|
|
verbose = True,
|
2022-06-02 11:42:42 +02:00
|
|
|
);
|
2022-03-30 18:00:11 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# EXECUTION
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
enter();
|