New answers tagged graph-theory
0
votes
0
votes
0
votes
1
vote
5
votes
Ways to paint a backbone on a tree
Python, 161 150 bytes
-11 bytes thanks to @xnor's idea in the comments
...
1
vote
Ways to paint a backbone on a tree
Scala 3, 1987 bytes
A port of @Ajax1234's Python code in Scala.
1987 bytes, it can be golfed much more.
Golfed version. Attempt This Online!
...
0
votes
5
votes
Ways to paint a backbone on a tree
Charcoal, 149 135 bytes
≔Eθ⊞O⌕AS1κθ≔EθEθυηFθFEθλF§θκ«≔E⁻§θκ⟦κλ⟧§§ημκζ≔⟦⟧εW⁻ζεF№ζ⌊μ⊞ε⌊μ§≔§ηκλε»≔ΦEθ⟦κι⟧⁼²L⊟ιζFζ«≔⁻§θ§ι⁰ιε¿εFε⊞ζ⁺⟦κ⟧ι⊞υE駧ηκκ»UMυ⌊⟦ι⮌ι⟧ILΦυ⁼κ⌕υι
Try ...
13
votes
Ways to paint a backbone on a tree
Python, 238 bytes
-7 bytes thanks to @Neil
-8 bytes thanks to @emanresu A
-5 bytes thanks to @xnor
+72 bytes due to a very serious bug (pointed out by @Jonathan Allan); bugged version
...
2
votes
0
votes
Top 50 recent answers are included
Related Tags
graph-theory × 204code-golf × 178
decision-problem × 32
grid × 22
math × 19
path-finding × 16
combinatorics × 15
code-challenge × 12
optimization × 9
ascii-art × 7
array × 7
maze × 6
sequence × 5
fastest-code × 5
chess × 5
string × 4
geometry × 4
game × 4
matrix × 4
permutations × 4
fastest-algorithm × 4
binary-matrix × 4
graphical-output × 3
sorting × 3
atomic-code-golf × 3