Simple question about indexing edges of an undirected graph.

84 Views Asked by At

As far as I understand, for an undirected graph $\mathcal{G}=(\mathcal{N},\mathcal{E})$, the set of edges is defined as unordered 2-element subsets of $\mathcal{N}$. So, for example, $\mathcal{E} = \{\{1,2\},\{1,3\},\{2,3\}\}$.

Say that I wish to sum over all edges, what does the following result in? \begin{align*} \sum_{(i,j)\in\mathcal{E}}(x_i+x_j) \end{align*} Does $\{1,2\} = \{(1,2),(2,1)\}$? Is there a more standard way to write the sum?

1

There are 1 best solutions below

4
On BEST ANSWER

The correct way, it seems to me, would be writing it as follows: $$\sum_{\{i,j\}\in\cal E}i+j$$

The index set is all the edges, and for each edge we sum its two vertices. Of course, this means that the vertices belong to some structure which includes addition.

To your second question $\{1,2\}$ is the set with two elements, $1$ and $2$. The set $\{(1,2),(2,1)\}$ is a set with two elements, both of which are ordered pairs $(1,2)$ and $(2,1)$. Generally natural numbers are not ordered pairs, so the two sets are not the same.