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
c107c7d0
Commit
c107c7d0
authored
3 years ago
by
Radek Hušek
Browse files
Options
Downloads
Patches
Plain Diff
Drop HamiltonianCycle
It is broken
parent
766330a8
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
graph_tools/parameters.py
+0
-61
0 additions, 61 deletions
graph_tools/parameters.py
with
0 additions
and
61 deletions
graph_tools/parameters.py
+
0
−
61
View file @
c107c7d0
...
...
@@ -174,67 +174,6 @@ def _init_():
def
finalize
(
self
,
b
):
return
b
[
0
].
value
@Singleton
class
HamiltonianCycle
(
GraphParameterBase
):
FREE_EDGE
=
[
BV
((
1
,
1
),
1
),
BV
((
None
,
None
),
1
)
]
CUBIC_VERTEX
=
[
BV
((
1
,
1
,
None
),
1
),
BV
((
1
,
None
,
1
),
1
),
BV
((
None
,
1
,
1
),
1
)
]
def
join_boundaries
(
self
,
x
,
_
):
offsets
=
[
0
]
try
:
for
b
in
x
:
offsets
.
append
(
offsets
[
-
1
]
+
max_
(
b
.
boundary
))
except
ValueError
:
return
def
shift
(
k
,
off
):
if
k
is
None
:
return
None
return
k
+
off
ret_b
=
tuple
(
chain
(
*
[
[
shift
(
x
,
offsets
[
i
])
for
x
in
b
.
boundary
]
for
i
,
b
in
enumerate
(
x
)
]))
yield
BV
(
ret_b
,
prod
(
b
.
value
for
b
in
x
))
def
join_edges
(
self
,
b
,
e1
,
e2
):
# print("%s %s %s" % (b, e1, e2))
c1
=
b
.
boundary
[
e1
]
c2
=
b
.
boundary
[
e2
]
if
c1
is
None
and
c2
is
None
:
yield
b
if
c1
is
None
or
c2
is
None
:
return
if
c1
!=
c2
:
if
c1
>
c2
:
c1
,
c2
=
c2
,
c1
boundary
=
tuple
(
v
if
v
!=
c2
else
c1
for
v
in
b
.
boundary
)
yield
BV
(
boundary
,
b
.
value
)
elif
max_
(
b
.
boundary
)
==
1
:
yield
b
def
project_and_canonize
(
self
,
p
,
b
):
boundary
=
select
(
p
,
b
)
rename
=
{
None
:
None
}
i
=
1
for
x
in
boundary
:
if
x
not
in
rename
:
rename
[
x
]
=
i
i
+=
1
boundary
=
tuple
(
rename
[
x
]
for
x
in
boundary
)
return
boundary
def
finalize
(
self
,
b
):
assert
len
(
b
)
<=
1
if
len
(
b
)
==
0
:
return
0
assert
b
[
0
].
boundary
==
tuple
()
return
b
[
0
].
value
@Singleton
class
CircuitDoubleCover
(
GraphParameterBase
):
FREE_EDGE
=
[
BV
(((
1
,
2
),
(
1
,
2
),
None
),
Fraction
(
1
,
2
))
]
...
...
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