<p>Topology is the study of how &quot;shapes&quot; change when you apply continuous transformations to them. The central object of study is a topological space, which can be thought of as a way of saying which parts of an object are close to which other parts or how an object's pieces fit together. A graph (the kind with nodes and edges) is a topological space if you consider edges to be line segments from one vertex to another. You can ask questions like &quot;How far away is this point from that one?&quot; or &quot;is this point between these other two points?&quot;.</p>
<p>In this light, a topological ordering could be viewed as a continuous (meaning &quot;no cutting&quot;) function from the graph to <span class="math-container">$\mathbb{R}$</span> such that the restriction to each edge is monotonically increasing (with respect to the orders on <span class="math-container">$\mathbb{R}$</span> and the directedness of the edge), and such that no two vertices are mapped to the same point.</p>
<p>You're &quot;continuously squishing the graph to a line&quot; in a way that edges point forward, and then the nodes of the graph are ordered based on the order of the associated real number.</p>
<p>Edit: Note that this is probably not the origin of why the term &quot;topological&quot; was applied, but it is one sense in which topological sort is topological.</p>

CC BY-SA 4.0
2021-12-26T20:20:48.940Z
2022-01-01T23:34:37.317Z
2022-01-01T23:34:37.317Z
user513093
<p>The word &quot;topology&quot; does not come from the mathematical field that often talks about doughnuts and coffee mugs. &quot;Topology&quot; just means a topologic study... that is, a study of the shape of something. You might recall topographic maps in geography class or you might be aware of the idea of 'network topology' which just generally means &quot;the shape of a network.&quot; Network practitioners, for example, will talk about a &quot;star topology&quot; which simply is a network in a star shape, or a &quot;ring topology&quot; which simply means &quot;in a ring shape.&quot; People can also refer to the topological landscape of a country, without really trying to refer to homeomorphisms, but instead the shape of the rivers and mountains.</p>
<p>Under the understanding that &quot;topological&quot; means &quot;pertaining to shape&quot;, a &quot;topological sort&quot; simply means &quot;a spacial sort.&quot;</p>
<p>It might be that the mathematical field of 'topology' is some student's first memorable encounter of the word that causes this kind of question to pop up regularly (I had a topologist once tell me he went to a networks conference because he saw a lot of mention of 'topology' and he felt that everyone was using the term incorrectly.) And I think that is why I have not yet had an algebraist ask me why &quot;social groups&quot; are called &quot;groups&quot; without even defining an operation on the elements.</p>

CC BY-SA 4.0
2022-01-01T23:54:08.410Z
I think I see your point--I edited my answer to hopefully clarify. I'd still argue that a great general way to formalize this notion of "shape" is with the tools of topology. I would consider even informal discussions about these sorts of "shapes of things" (e.g. counting a graph's cycles) to be topological, regardless of whether the people talking know about open sets. But it's often just one way to frame the discussion, made more or less relevant by context. As an analogy, 1st-graders aren't really learning CS when they learn long-addition, but I'd still say that they're doing an algorithm.
user513093
CC BY-SA 4.0
2021-12-30T02:44:46.273Z
2021-12-30T02:44:46.273Z
JimN
<p>The topology of a set of items is how they are connected. Topological sorting is sorting items based only on their topology.</p>

CC BY-SA 3.0
2015-03-03T19:09:46.057Z
2015-03-03T19:09:46.057Z
reinierpost
<p>The earliest reference I could find for topological sort is from [Lasser61]:</p>

<blockquote>
  <p>A network of directed line segments free of circular elements is assumed. The lines are identified by their terminal nodes and the nodes are assumed to be numbered by a non-topological system. Given a list of these lines in numeric order, a simple technique can be used to create at high speed a list in topological order.</p>
</blockquote>

<p>I don't have access to this article right now but I would wager that the "topology" in "topological sort" does not come from the mathematical notion of topology (e.g.: open sets, compactness, etc...) but rather from the "<a href="http://en.wikipedia.org/wiki/Network_topology">network topology</a>" sense.</p>

<p>[Lasser61] Lasser, Daniel J. "<a href="http://dl.acm.org/citation.cfm?id=366314">Topological ordering of a list of randomly-numbered elements of a network.</a>" Communications of the ACM 4, no. 4 (1961): 167-168.</p>

CC BY-SA 3.0
2015-03-03T02:36:49.210Z
Another hint that network topology rather than the mathematical meaning of topological is intended is that the term used in pure mathematics for almost the same idea (possibly first used by Dushnik and Miller 1941) is "linear extension" rather than "topological order".
David Eppstein
CC BY-SA 3.0
2015-03-04T12:38:32.973Z
@mhum It looks like the term may have originated with Jarnagin (1960) Automatic machine methods of testing PERT networks for consistency (note: "PERT networks"). There don't seem to be a lot of copies of this floating around but I'm going to request one via inter-library loan and see what it says.
PartialOrder
CC BY-SA 4.0
2021-12-26T20:02:20.167Z
The term "network topology" refers to the graph structure in the connectivity of devices in the network, and graphs are naturally topological spaces.
user513093
CC BY-SA 3.0
2015-03-02T21:26:17.887Z
2015-03-02T21:26:17.887Z
mhum
<p>Why is "topological sorting" called "topological"? Is it just because it determines an order without altering any vertices or edges -- like a doughnut and coffee cup are topologically equivalent? Why is it not called "dependency sort" or something else? Why "topological"? I admit I'm mystified. </p>

<graph-theory><graph-algorithms><directed-acyclic-graph><topology><topological-sorting>
Why is "topological sorting" topological?
PartialOrder
# Why is "topological sorting" topological?

(Asked by: username_0 on 2015-03-02)

Why is "topological sorting" called "topological"? Is it just because it determines an order without altering any vertices or edges -- like a doughnut and coffee cup are topologically equivalent? Why is it not called "dependency sort" or something else? Why "topological"? I admit I'm mystified.

**Tags:** graph-theory, graph-algorithms, directed-acyclic-graph, topology, topological-sorting


---

## 4 answers

### Answer by username_4 on 2015-03-02. Score: 20 | Accepted answer

The earliest reference I could find for topological sort is from [Lasser61]:

> A network of directed line segments free of circular elements is assumed. The lines are identified by their terminal nodes and the nodes are assumed to be numbered by a non-topological system. Given a list of these lines in numeric order, a simple technique can be used to create at high speed a list in topological order.

I don't have access to this article right now but I would wager that the "topology" in "topological sort" does not come from the mathematical notion of topology (e.g.: open sets, compactness, etc...) but rather from the "[network topology](http://en.wikipedia.org/wiki/Network_topology)" sense.

[Lasser61] Lasser, Daniel J. "[Topological ordering of a list of randomly-numbered elements of a network.](http://dl.acm.org/citation.cfm?id=366314)" Communications of the ACM 4, no. 4 (1961): 167-168.

> **Comments:**
> **username_5**: Another hint that network topology rather than the mathematical meaning of topological is intended is that the term used in pure mathematics for almost the same idea (possibly first used by Dushnik and Miller 1941) is "linear extension" rather than "topological order".  
> **username_0**: @username_4 It looks like the term may have originated with Jarnagin (1960) Automatic machine methods of testing PERT networks for consistency (note: "PERT networks"). There don't seem to be a lot of copies of this floating around but I'm going to request one via inter-library loan and see what it says.  
> **username_1**: The term "network topology" refers to the graph structure in the connectivity of devices in the network, and graphs are naturally topological spaces.  

---

### Answer by username_1 on 2021-12-26. Score: 1

Topology is the study of how "shapes" change when you apply continuous transformations to them. The central object of study is a topological space, which can be thought of as a way of saying which parts of an object are close to which other parts or how an object's pieces fit together. A graph (the kind with nodes and edges) is a topological space if you consider edges to be line segments from one vertex to another. You can ask questions like "How far away is this point from that one?" or "is this point between these other two points?".

In this light, a topological ordering could be viewed as a continuous (meaning "no cutting") function from the graph to $\mathbb{R}$ such that the restriction to each edge is monotonically increasing (with respect to the orders on $\mathbb{R}$ and the directedness of the edge), and such that no two vertices are mapped to the same point.

You're "continuously squishing the graph to a line" in a way that edges point forward, and then the nodes of the graph are ordered based on the order of the associated real number.

Edit: Note that this is probably not the origin of why the term "topological" was applied, but it is one sense in which topological sort is topological.


---

### Answer by username_2 on 2021-12-30. Score: 0

The word "topology" does not come from the mathematical field that often talks about doughnuts and coffee mugs. "Topology" just means a topologic study... that is, a study of the shape of something. You might recall topographic maps in geography class or you might be aware of the idea of 'network topology' which just generally means "the shape of a network." Network practitioners, for example, will talk about a "star topology" which simply is a network in a star shape, or a "ring topology" which simply means "in a ring shape." People can also refer to the topological landscape of a country, without really trying to refer to homeomorphisms, but instead the shape of the rivers and mountains.

Under the understanding that "topological" means "pertaining to shape", a "topological sort" simply means "a spacial sort."

It might be that the mathematical field of 'topology' is some student's first memorable encounter of the word that causes this kind of question to pop up regularly (I had a topologist once tell me he went to a networks conference because he saw a lot of mention of 'topology' and he felt that everyone was using the term incorrectly.) And I think that is why I have not yet had an algebraist ask me why "social groups" are called "groups" without even defining an operation on the elements.

> **Comments:**
> **username_1**: I think I see your point--I edited my answer to hopefully clarify. I'd still argue that a great general way to formalize this notion of "shape" is with the tools of topology. I would consider even informal discussions about these sorts of "shapes of things" (e.g. counting a graph's cycles) to be topological, regardless of whether the people talking know about open sets. But it's often just one way to frame the discussion, made more or less relevant by context. As an analogy, 1st-graders aren't really learning CS when they learn long-addition, but I'd still say that they're doing an algorithm.  

---

### Answer by username_3 on 2015-03-03. Score: -1

The topology of a set of items is how they are connected. Topological sorting is sorting items based only on their topology.


---

