Hacker News new | ask | show | jobs
by lou1306 843 days ago
Well to be fair, that constraint is also part of the mathematical definition of a graph, where the set of edges E is a binary relation over vertices V (i.e., a subset of V x V). You'd need either a multiset or a labelled relation (i.e., a subset of V x L x V for some set of labels L) to overcome that.
1 comments

There is no "the" definition. From Wikipedia:

"Definitions in graph theory vary. [...] A multigraph is a generalization that allows multiple edges to have the same pair of endpoints. In some texts, multigraphs are simply called graphs."

It's a bit disingenuous to skip over the Graph subsection of that article, right after the "definitions vary" line:

> A graph (sometimes called an undirected graph to distinguish it from a directed graph, or a simple graph to distinguish it from a multigraph) is a pair G = (V, E), where V is a set whose elements are called vertices (singular: vertex), and E is a set of unordered pairs of vertices, whose elements are called edges (sometimes links or lines).

An unqualified "graph" is almost always this one—a simple, undirected graph. If you mean something different you almost always need to use one of the more specific names to be clear.

https://en.m.wikipedia.org/wiki/Graph_(discrete_mathematics)...

"Disingenuous"? Do you have to make this personal before looking for another explanation?

The parent comment I replied to said:

"Does A->B imply B->A?"

That "undirected" condition was already violated before I wrote anything.

Sorry, I didn't intend to make it personal, I was just pointing out that the very next paragraph after the chunk you quoted included the definition of "graph" that lou1306 was referring to, almost verbatim.

Definitions sometimes vary, but lou1306 is correct on the merits that the most widely accepted definition of an unqualified "graph" states that "the set of edges E is a binary relation over vertices V (i.e., a subset of V x V)".

Again, that objection makes no sense to my comment when it was already violated in the discussion before I wrote anything: "Are there colors? labels?"

If you'd like to object to it ("to be fair" or whatever), the parent comment I replied to would be the one to do so to.

You're pulling in context from ylow's post that isn't relevant to this subthread. I'm not defending ylow's definition, I'm defending lou1306's.

Here's the first few parts of the chain of thought of this subthread:

ylow> Fundamentally, all I need to define a graph is a set of vertices v \in V and function Neighbors(v).

You> Even that is severely overconstrained. It doesn't allow multiple edges to the same neighbor!

lou1306> Well to be fair, that constraint is also part of the mathematical definition of a graph ...

You> There is no "the" definition. From Wikipedia ...

You explicitly were only replying to the portion of ylow's comment that was about vertices and a neighbors function, and lou1306 was replying to your assertion that vertices+neighbors was overconstrained because it wouldn't allow multiple edges. All I'm saying is that lou1306 is correct in their definition of a graph. If that means that both you and ylow are wrong, that's fine with me!