MikeTrendsTrends right now

Mmastodon TechnologySoftware first seen 5 h ago, last 5 h ago, peak #3

Why topological sort gives a different answer on every run

Original: You have a few tasks, and some of them depend on others. You put them in a graph, sort it... # go # algorithms # opensou

A developer has written about a common pitfall in topological sorting: when several valid orderings exist, the algorithm may return a different sequence each run, since standard implementations make arbitrary choices among nodes with no remaining dependencies. The piece walks through why this nondeterminism happens and how to make results stable, and is being shared among programmers interested in Go, algorithms and open-source software.

Why now: It highlights a subtle algorithmic behaviour that surprises developers who expect deterministic output from sorting task dependencies.

topological sortGoopen-source software

Open on mastodon →

Evidence

API: https://socialmediatrends-api.osmike.com/v1/trends/1115202