Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Binary paint shop problem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
Binary paint shop problem
Commits
b8e6261c
Commit
b8e6261c
authored
1 year ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
prace: Máme 1 000 testů
parent
a7dd05ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
prace/bakalarka/g.py
+2
-2
2 additions, 2 deletions
prace/bakalarka/g.py
prace/bakalarka/index.md
+13
-14
13 additions, 14 deletions
prace/bakalarka/index.md
with
15 additions
and
16 deletions
prace/bakalarka/g.py
+
2
−
2
View file @
b8e6261c
...
...
@@ -46,7 +46,7 @@ def intro_graph(algo):
fig
.
update_layout
(
showlegend
=
False
)
return
fig
def
nonzero_coords
(
n
,
seeds
,
max_dim
=
20
):
def
nonzero_coords
(
n
,
max_dim
=
20
):
data_dir
=
d
/
"
main_test/sdp/nonzero_coord
"
nonzero_coords
=
[[
float
(
i
)
for
i
in
open
(
data_dir
/
f
).
read
().
split
()]
for
f
in
os
.
listdir
(
data_dir
)
if
f
.
startswith
(
f
"
{
n
}
-
"
)]
...
...
@@ -68,7 +68,7 @@ def nonzero_coords(n, seeds, max_dim=20):
)
return
fig
def
max_coords
(
n
,
seeds
,
max_dim
=
20
):
def
max_coords
(
n
,
max_dim
=
20
):
data_dir
=
d
/
"
main_test/sdp/max_coord
"
max_coords
=
[[
float
(
i
)
for
i
in
open
(
data_dir
/
f
).
read
().
split
()]
for
f
in
os
.
listdir
(
data_dir
)
if
f
.
startswith
(
f
"
{
n
}
-
"
)]
...
...
This diff is collapsed.
Click to expand it.
prace/bakalarka/index.md
+
13
−
14
View file @
b8e6261c
...
...
@@ -389,7 +389,7 @@ fig.add_vline(x=200*hypoth,
annotation_text="hypotéza", annotation_position="top left",
fillcolor="green")
```
Graf skóre $100$ běhů hvězdičkového rekurzivního řešení pro $n=200$.
Graf skóre $1
\,
0
00$ běhů hvězdičkového rekurzivního řešení pro $n=200$.
:::
Autoři algoritmu o něm vyslovili domněnku, že $
\d
elta_{
\a
lgo{rsg}} = {1
\o
ver 13}
\c
dot
\s
qrt{61} - {3
\o
ver 13}
\d
oteq 0.370$.
...
...
@@ -842,7 +842,7 @@ Měření řešení BPS
=================
Součástí práce je implementace algoritmů řešících Binární paint shop problém.
Každý z nich byl následně spuštěn pro různé velikosti, pokaždé na
100
nezávisle náhodně vybraných vstupech s počtem typů aut
Každý z nich byl následně spuštěn pro různé velikosti, pokaždé na
$1
\,
000$
nezávisle náhodně vybraných vstupech s počtem typů aut
10, 20, 50, 100, 200, 400, 566, 800, 1131, 1600, 2263 a 3200.[^2]
Jedna z implementací $
\a
lgo{sdp}$ -- pomocí sage vyžaduje moc paměti a proto byla spuštěna jen na vstupech do velikosti $566$.
Celý test běžel jednovláknově zhruba dva dny a využíval nejvýše 16 GB operační paměti.
...
...
@@ -1043,7 +1043,7 @@ Vizualizace jednoho z řešení pro $n=50$, které se vejde do 3D.
::: {#max_coords_400 c=figure floatpage=400}
```
python {c=plotly}
from bakalarka import g
fig = g.max_coords(400
, range(1, 101)
)
fig = g.max_coords(400)
```
Maximální hodnota v dané dimenzi pro $n=400$.
:::
...
...
@@ -1051,7 +1051,7 @@ Maximální hodnota v dané dimenzi pro $n=400$.
::: {#nonzero_coords_400 c=figure floatpage=400!}
```
python {c=plotly}
from bakalarka import g
fig = g.nonzero_coords(400
, range(1, 101)
)
fig = g.nonzero_coords(400)
```
Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=400$.
:::
...
...
@@ -1060,7 +1060,7 @@ Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=400$.
::: {#max_coords_200 c=figure floatpage=200}
```
python {c=plotly}
from bakalarka import g
fig = g.max_coords(200
, range(1, 101)
)
fig = g.max_coords(200)
```
Maximální hodnota v dané dimenzi pro $n=200$.
:::
...
...
@@ -1068,7 +1068,7 @@ Maximální hodnota v dané dimenzi pro $n=200$.
::: {#nonzero_coords_200 c=figure floatpage=200!}
```
python {c=plotly}
from bakalarka import g
fig = g.nonzero_coords(200
, range(1, 101)
)
fig = g.nonzero_coords(200)
```
Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=200$.
:::
...
...
@@ -1076,7 +1076,7 @@ Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=200$.
::: {#max_coords_100 c=figure floatpage=100}
```
python {c=plotly}
from bakalarka import g
fig = g.max_coords(100
, range(1001, 1101)
)
fig = g.max_coords(100)
```
Maximální hodnota v dané dimenzi pro $n=100$.
:::
...
...
@@ -1084,7 +1084,7 @@ Maximální hodnota v dané dimenzi pro $n=100$.
::: {#nonzero_coords_100 c=figure floatpage=100!}
```
python {c=plotly}
from bakalarka import g
fig = g.nonzero_coords(100
, range(1001, 1101)
)
fig = g.nonzero_coords(100)
```
Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=100$.
:::
...
...
@@ -1092,7 +1092,7 @@ Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=100$.
::: {#max_coords_50 c=figure floatpage=50}
```
python {c=plotly}
from bakalarka import g
fig = g.max_coords(50
, range(2001, 2101)
)
fig = g.max_coords(50)
```
Maximální hodnota v dané dimenzi pro $n=50$.
:::
...
...
@@ -1100,7 +1100,7 @@ Maximální hodnota v dané dimenzi pro $n=50$.
::: {#nonzero_coords_50 c=figure floatpage=50!}
```
python {c=plotly}
from bakalarka import g
fig = g.nonzero_coords(50
, range(2001, 2101)
)
fig = g.nonzero_coords(50)
```
Počet vektorů s danou souřadnicí větší než $0.05$ pro $n=50$.
:::
...
...
@@ -1232,19 +1232,19 @@ def gen_alg(pipeline_name, algo_name, name_suffix, floatpage, add_note=False):
pipeline = data.pipelines[pipeline_name]
by_n = data_lib.group_by_n(pipeline)
rows = []
percentils = [
10,50,
90]
percentils = [
5, 25, 50,75,
90]
print_errors = any(i.error or i.data.get("broken", False) for i in pipeline)
for n in sorted(by_n.keys()):
d = by_n[n]
scores = [ i.score/n for i in d]
scores.sort()
l = len(scores)
assert l == 1000
avg = sum(scores) / l
variance = sum((avg-i)**2 for i in scores)/(l-1)
errors = len([None for i in d if i.error or i.data.get("broken", False)])
rows.append(row(
n,
l,
*([errors] if print_errors else []),
avg,
math.sqrt(variance),
...
...
@@ -1253,7 +1253,6 @@ def gen_alg(pipeline_name, algo_name, name_suffix, floatpage, add_note=False):
table = pf.Table(pf.TableBody(*rows), head=pf.TableHead(row(
[pf.Math("n", format='InlineMath')],
"testů",
*(["chyb"] if print_errors else []),
[pf.Math("\\overline{\\delta_{\\algo{"+algo_name+"}}(n)}", format='InlineMath')],
[pf.Math("\\sqrt{\widehat{\\delta_{\\algo{"+algo_name+"}}(n)^2}}", format='InlineMath')],
...
...
@@ -1319,7 +1318,7 @@ fig.update_layout(
)
```
Horní a dolní odhad na
100
náhodných instancí vygenerovaný sage $
\a
lgo{spd}$.
Horní a dolní odhad na
$1
\,
000$
náhodných instancí vygenerovaný sage $
\a
lgo{spd}$.
:::
Takto vygenerovaný dolní odhad nám bohužel nepřináší žádnou zajímavou informaci o chování na náhodném vstupu.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment