Skip to content

Commit 689d7bc

Browse files
committed
added slides
1 parent 81b4c81 commit 689d7bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+12351
-79
lines changed

Report.thy

Lines changed: 161 additions & 79 deletions
Large diffs are not rendered by default.

document/root.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@
4242
\newcommand{\HeWidth}{1.5}
4343
\newcommand{\HeHeight}{1}
4444
\newcommand{\HeMargin}{0.5}
45+
\newcommand*{\edgeBend}{50}
4546

4647
\colorlet{mygreen}{green!80!blue}
4748
\tikzset{
4849
graphNode/.style={circle,fill,inner sep=0.05cm},
4950
hpEndpoint/.style={circle,fill=mygreen,inner sep=0.075cm},
5051
hpEdge/.style={draw=mygreen,ultra thick},
52+
edge4/.style={bend left=\edgeBend},
5153
pics/He/.style n args={2}{code={
5254
\node at (-0.25,0) {{#1}};
5355
\node at (-0.25,\HeHeight) {{#1}};

output/document.pdf

12 KB
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import itertools
2+
3+
c = [
4+
[0,2,3,3,3],
5+
[2,0,2,3,1],
6+
[3,2,0,3,2],
7+
[3,3,3,0,2],
8+
[3,1,2,2,0],
9+
]
10+
11+
for x in range(0,5):
12+
for y in range(0,5):
13+
for z in range(0,5):
14+
if c[x][z] > c[x][y] + c[y][z]:
15+
print(f'c {x+1} {z+1} > c {x+1} {y+1} + c {y+1} {z+1}')
16+
17+
min_tour = []
18+
min_cost = float('inf')
19+
for p in list(itertools.permutations(range(0,5))):
20+
tour = list(p)
21+
tour.append(tour[0])
22+
cost = sum(list(map(lambda e: c[e[0]][e[1]], zip(tour[:-1],tour[1:]))))
23+
if cost < min_cost:
24+
min_tour = tour
25+
min_cost = cost
26+
27+
print(min_cost)
28+
print(min_tour)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% Graph saved at Sun Apr 16 2023 17:17:10 GMT+0200 (Mitteleuropäische Sommerzeit)
2+
n 142.65821432765526 369.66020158193646 1
3+
n 274.4620117960097 469.1747646887325 2
4+
n 456.10758141626286 386.6504928440724 3
5+
n 376.3607459732249 207.03884235863546 4
6+
n 217.97467002385778 207.03884235863546 5
7+
e 4 1 1 3
8+
e 1 5 2 3
9+
e 5 2 3 1
10+
e 1 2 9 2
11+
e 2 3 10 2
12+
e 4 5 12 2
13+
e 1 3 23 3
14+
e 2 4 24 3
15+
e 3 5 25 3
16+
e 3 4 26 3

0 commit comments

Comments
 (0)