MathDB
Weird identity for a graph

Source: Tuymaada 2023 Senior P2

July 7, 2023
combinatorics

Problem Statement

In a graph with nn vertices every two vertices are connected by a unique path. For each two vertices uu and vv, let d(u,v)d(u, v) denote the distance between uu and vv, i.e. the number of edges in the path connecting these two vertices, and deg(u)\deg(u) denote the degree of a vertex uu. Let WW be the sum of pairwise distances between the vertices, and DD the sum of weighted pairwise distances: {u,v}(deg(u)+deg(v))d(u,v)\sum_{\{u, v\}}(\deg(u)+\deg(v))d(u, v). Prove that D=4Wn(n1)D=4W-n(n-1).