frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Fastest Way yet to Color Graphs

https://www.quantamagazine.org/the-fastest-way-yet-to-color-graphs-20250512/
62•GavCo•7mo ago

Comments

tonyarkles•7mo ago
In case you haven't looked at the article, this is looking specifically at the Edge Coloring problem and not the more commonly known Vertex Coloring problem. Vertex Coloring is NP-complete unfortunately.
erikvanoosten•7mo ago
You can convert edge coloring problems into vertex coloring problems and vice versa through a simple O(n) procedure.
meindnoch•7mo ago
Wrong. You can convert edge-coloring problems into vertex-coloring problems of the so-called line graph: https://en.m.wikipedia.org/wiki/Line_graph

But the opposite is not true, because not every graph is a line graph of some other graph.

erikvanoosten•6mo ago
Indeed. Thanks, I stand corrected.
tonyarkles•7mo ago
Hrm... right. It's been a while. And it looks like both Vertex Coloring and Edge Coloring are both NP-complete (because of the O(n) procedure you're talking about and the ability to reduce both problems down to 3-SAT). I've started looking closer at the actual paper to try to figure out what's going on here. Thanks for the reminder, I miss getting to regularly work on this stuff.

Edit: thanks sibling reply for pointing out that it's not a bidirectional transform.

mauricioc•7mo ago
For the edge-coloring problem, the optimal number of colors needed to properly color the edges of G is always either Delta(G) (the maximum degree of G) or Delta(G) + 1, but deciding which one is the true optimum is an NP-complete problem.

Nevertheless, you can always properly edge-color a graph with Delta(G) + 1 colors. Finding such a coloring could in principle be slow, though: the original proof that Delta(G) + 1 colors is always doable amounted to a O(e(G) * v(G)) algorithm, where e(G) and v(G) denote the number of edges and vertices of G, respectively. This is polynomial, but nowhere near linear. What the paper in question shows is how, given any graph G, to find an edge coloring using Delta(G) + 1 colors in O(e(G) * log(Delta(G))) time, which is linear time if the maximum degree is a constant.

Syzygies•7mo ago
Yes. The article ran through this point as follows:

"In 1964, a mathematician named Vadim Vizing proved a shocking result: No matter how large a graph is, it’s easy to figure out how many colors you’ll need to color it. Simply look for the maximum number of lines (or edges) connected to a single point (or vertex), and add 1."

I keep wondering why I ever read Quanta Magazine. It takes a pretty generous reading of "need" to make this a correct statement.

JohnKemeny•7mo ago
Not really. Coloring a graph is almost always talking about proper coloring, meaning that things that objects that are related receive different colors.

If you read the introduction, you'll also read that the goal is to "color each of your lines and require that for every point, no two lines connected to it have the same color."

Ps. "How many colors a graph needs" is a very well established term in computer science and graph theory.

mockerell•7mo ago
I think the comment referred to the phrase „a graph needs X (colors or whatever)“. For me, this can be read two ways: 1. „a graph always needs at least X colors“ or 2. „a graph always needs at most X colors“.

Personally, I would interpret this as option 1 (and so did the comment above I assume). In that case, the statement is wrong. But I’d prefer to specify „at most/ at least“ anyways.

Or even better, use actual vocabulary. „For every graph there exists a coloring with X colors.“ or „any graph can be coloured using X colors“.

PS: I also agree with the sentiment about quanta magazine. It’s hard to get some actual information from their articles if you know the topic.

JohnKemeny•6mo ago
What about this statement:

No matter how large a car is, it is easy to figure out how much money you'll need to buy it. Simply look at the price tag.

(From: No matter how large a graph is, it’s easy to figure out how many colors you’ll need to color it. Simply look for the maximum ...)

mauricioc•6mo ago
Parent's point is that sometimes (but not always) the store is perfectly fine selling you a car for $1 less than what the "price tag" of Delta(G)+1 dollars asks for, so "need" is a bit inaccurate.
phkahler•7mo ago
Is this going to lead to faster compile times? Faster register allocation...
john-h-k•7mo ago
Very few compilers actually use vertex coloring for register allocation
isaacimagine•7mo ago
Totally. The hard part isn't coloring (you can use simple heuristics to get a decent register assignment), rather, it's figuring out which registers to spill (don't spill registers in hot loops! and a million other things!).
NooneAtAll3•7mo ago
and this post isn't even about vertex coloring
DannyBee•7mo ago
No.

In SSA, the graphs are chordal, so were already easily colorable (relatively).

Outside of SSA, this is not true, but the coloring is still not the hard part, it's the easy part.

After 27 years within budget Austria open 6thlongest railway tunnel in the world

https://infrastruktur.oebb.at/en/projects-for-austria/railway-lines/southern-line-vienna-villach/...
160•fzeindl•2h ago•60 comments

4 billion if statements (2023)

https://andreasjhkarlsson.github.io//jekyll/update/2023/12/27/4-billion-if-statements.html
150•damethos•5d ago•60 comments

The tiniest yet real telescope I've built

https://lucassifoni.info/blog/miniscope-tiny-telescope/
153•chantepierre•6h ago•32 comments

From text to token: How tokenization pipelines work

https://www.paradedb.com/blog/when-tokenization-becomes-token
19•philippemnoel•22h ago•1 comments

GPT-5.2

https://openai.com/index/introducing-gpt-5-2/
1056•atgctg•19h ago•919 comments

Show HN: Tripwire: A new anti evil maid defense

https://github.com/fr33-sh/Tripwire
12•DoctorFreeman•1d ago•4 comments

The Tor Project is switching to Rust

https://itsfoss.com/news/tor-rust-rewrite-progress/
72•giuliomagnifico•1h ago•29 comments

Show HN: Autofix Bot – Hybrid static analysis and AI code review agent

7•sanketsaurav•16h ago•0 comments

Fedora: Open-source repository for long-term digital preservation

https://fedorarepository.org/
4•cernocky•17m ago•1 comments

Nokia N900 Necromancy

https://yaky.dev/2025-12-11-nokia-n900-necromancy/
366•yaky•13h ago•132 comments

Google de-indexed Bear Blog and I don't know why

https://journal.james-zhan.com/google-de-indexed-my-entire-bear-blog-and-i-dont-know-why/
240•nafnlj•12h ago•95 comments

How to break free from smart TV ads and tracking

https://arstechnica.com/gadgets/2025/12/the-ars-technica-guide-to-dumb-tvs/
17•fleahunter•49m ago•5 comments

What folk can do

https://folk.computer/guides/what-folk-can-do
16•luu•4d ago•8 comments

Octo: A Chip8 IDE

https://github.com/JohnEarnest/Octo
18•tosh•6d ago•2 comments

Training LLMs for Honesty via Confessions

https://arxiv.org/abs/2512.08093
11•arabello•3h ago•2 comments

Rivian Unveils Custom Silicon, R2 Lidar Roadmap, and Universal Hands Free

https://riviantrackr.com/news/rivian-unveils-custom-silicon-r2-lidar-roadmap-universal-hands-free...
329•doctoboggan•19h ago•446 comments

The highest quality codebase

https://gricha.dev/blog/the-highest-quality-codebase
576•Gricha•3d ago•362 comments

CRISPR fungus: Protein-packed, sustainable, and tastes like meat

https://www.isaaa.org/kc/cropbiotechupdate/article/default.asp?ID=21607
199•rguiscard•12h ago•110 comments

BehindTheMedspeak: A Spinal Tap

https://bookofjoe2.blogspot.com/2025/10/behindthemedspeak-this-is-spinal-tap.html
3•surprisetalk•4d ago•0 comments

Programmers and software developers lost the plot on naming their tools

https://larr.net/p/namings.html
331•todsacerdoti•19h ago•434 comments

Spirograph style Lego drawing machine

https://jkbrickworks.com/simple-drawing-machine/
26•ensocode•4d ago•5 comments

An SVG is all you need

https://jon.recoil.org/blog/2025/12/an-svg-is-all-you-need.html
281•sadiq•18h ago•113 comments

Smartphone without a battery (2022)

https://yaky.dev/2022-09-06-smartphone-without-battery/
47•MYEUHD•6h ago•13 comments

Guarding My Git Forge Against AI Scrapers

https://vulpinecitrus.info/blog/guarding-git-forge-ai-scrapers/
64•todsacerdoti•5h ago•45 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
626•__rito__•1d ago•258 comments

Litestream VFS

https://fly.io/blog/litestream-vfs/
318•emschwartz•19h ago•78 comments

Denial of service and source code exposure in React Server Components

https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-comp...
303•sangeeth96•16h ago•185 comments

Stoolap: High-performance embedded SQL database in pure Rust

https://github.com/stoolap/stoolap
89•murat3ok•13h ago•26 comments

Craft software that makes people feel something

https://rapha.land/craft-software-that-makes-people-feel-something/
311•lukeio•23h ago•151 comments

Show HN: Sim – Apache-2.0 n8n alternative

https://github.com/simstudioai/sim
214•waleedlatif1•20h ago•46 comments