first order expressions on graphs

106 Views Asked by At

I recently saw a short example of how a graph property $Q$ can be expressed as a first order sentence. Namely "G has diameter $2$" can be expressed as

$$\forall x, \forall y, \exists z((x=y) \lor(x \sim y)\lor((x\sim z)\land (y \sim z)))$$

Now my knowledge of first order logic is pretty limited/non-existent i know a little bit about truth tables and how a few logical formulas work, but i had an issue with this statement. Technically doesn't the complete graph on $n$ vertices $K_{n}$ satisfy this sentence as for any pair of vertices $x,y$ which are not equal it is true that $(x \sim y)$, however the complete graph does not have diameter $2$ since it's diameter is $1$. So how can this first order sentence correctly describe the property?

1

There are 1 best solutions below

2
On

You're right, it says that the graph has diameter no larger than $2$. It's not hard to come up with another formula that says the diameter is at least $2$...