Look at Edge : [u1, v1]. Look at Edge : [u2, v2]. One of the numbers in Edge must be the center. One of the numbers in Edge must also be the center.
The center is the common node. Compare u1 with u2 and v2. If u1 equals either, return u1. Otherwise, return v1.
if u1 = u2 or u1 = v2 then
return u1
else
return v1
This runs in constant time regardless of graph size. Two edges are enough to identify the unique center.