Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdc-counting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radek Hušek
cdc-counting
Commits
4659afda
Commit
4659afda
authored
4 years ago
by
Radek Hušek
Browse files
Options
Downloads
Patches
Plain Diff
improve test_exp_cdc.sh experiment
parent
f12d7de1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
experiments/test_exp_cdc.sh
+69
-7
69 additions, 7 deletions
experiments/test_exp_cdc.sh
with
69 additions
and
7 deletions
experiments/test_exp_cdc.sh
+
69
−
7
View file @
4659afda
#!/bin/bash
# Test conjecture that every bridgeless cubic graph has
# at least 2^{n/2 - 1} circuit double covers on all
# graphs on $1 vertices. We know that minimal
# counterexample does not have 3 or 4-cycle so we skip
# those.
SIZES
=
"4 6 8 10 12 14 16 18 20"
DOC
=
"
Test conjecture that every bridgeless cubic graph has
at least 2^{n/2 - 1} circuit double covers on all
graphs of given size. We know that minimal
counterexample does not have 3 or 4-cycle so we skip
those.
The arguments should be the sizes of the graphs
to be tested. If it is empty it defaults to
$SIZES
.
It requires geng from Nauty packaget to be in the PATH.
WARNING: This experiment takes a long time to complete.
"
echo
"
$DOC
"
export
PYTHONUNBUFFERED
=
x
geng
-Ctfd3D3
$1
|
nice
sage
-python3
../count_cdc.py
>
${
0
%.sh
}
_
$1
.log
if
[[
-n
"
$*
"
]]
;
then
SIZES
=
"
$*
"
fi
:
${
LOG
:
=
${
0
%.sh
}
-
$SIZES
.log
}
:
${
GENG
:
=geng
}
SELF
=
"
$(
readlink
-f
"
$0
"
)
"
for
s
in
$SIZES
;
do
"
$GENG
"
-Ctfd3D3
$s
done
|
nice
python /dev/fd/5
"
$(
dirname
"
$SELF
"
)
"
"
$LOG
"
5
<<
'
EOF
'
if True:
import sys, os
sys.path.append(sys.argv[1] + "/..")
import json
from graph_tools.misc import count_cdc_naive
from sage.all import Graph
from parmap import parmap
def process(l):
G = Graph(l)
ret = count_cdc_naive(G)
j = {
"cdc_count": ret[0],
"n": G.num_verts(),
"expected_cdc_lowerbound": ret[1],
"is_ok": (ret[0] >= ret[1])
}
return json.dumps(j), j["is_ok"]
inp = os.fdopen(sys.stdin.fileno())
sys.stdin = None
nprocs = int(os.getenv("NPROCS", "0")) or None
with open(sys.argv[2], "w") as log:
sys.stdout.write(" Processed 0 (failed 0)")
failed = 0
for i, (l, is_ok) in enumerate(parmap(process, inp, nprocs=nprocs, in_order=False)):
log.write(l + "
\n
")
failed += not is_ok
sys.stdout.write("
\0
33[1K
\r
Processed %i (failed %i)" % (i+1, failed))
sys.stdout.flush()
print("
\n
Done")
EOF
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