on realizing all simple graphs with a given.pdf

Upload: phoeberamos

Post on 02-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 On realizing all simple graphs with a given.pdf

    1/6

    On realizing all simple graphs with a given

    degree sequence

    Hyunju Kim a, Zoltan Toroczkai a, , Istvan Miklos b,c ,Peter L. Erdos c, Laszlo A. Szekely d

    aDepartment of Physics and Center for Complex Network Research, University of

    Notre Dame, Notre Dame, IN, 46556, USA

    bDepartment of Statistics, University of Oxford, 1 South Parks Road, OX1 3TG

    Oxford, UK

    cA. Renyi Institute of Mathematics, Hungarian Academy of Sciences, Budapest,

    PO Box 127, H-1364, HungarydDepartment of Mathematics, University of South Carolina, Columbia, SC 29208,

    USA

    Abstract

    We give a necessary and sufficient condition for a sequence of nonnegative integersto be realized as a simple graphs degree sequence such that a given (but otherwisearbitrary) set of possible connections from a node are avoided. We then use this

    result to present a procedure that builds all simple graphs realizing a given degreesequence.

    Key words: degree sequence; graphical sequence; Erdos-Gallai theorem;Hakimi-Havel theorem; generating graphs

    A sequence d = {d1, d2, . . . , dn} of nonnegative integers is called a graphicalsequence if a simple graph G(V, E) exists on n nodes, V = {v1, v2, . . . , vn},whose degree sequence is d. In this case we say that G realizes the sequence

    d. For simplicity of the notation we will identify node vi by the integer i andwe will consider only sequences of strictly positive integers (dn > 0) to avoidisolated points.

    ELP was partly supported by Hungarian NSF, under contract Nos. NK62321,AT048826 and K 68262, and LAS by NSF DMS # 0701111. Corresponding author.

    Email address: [email protected] (Zoltan Toroczkai).

    Preprint submitted to Discrete Mathematics 29 April 2008

  • 7/27/2019 On realizing all simple graphs with a given.pdf

    2/6

    There are two well-known necessary and sufficient conditions for a sequenceof nonnegative integers to be graphical: one was given independently by Havel[3] and Hakimi [2] while the other is due to Erdos and Gallai [1].

    Theorem 1 (Hakimi-Havel) There exists a simple graph with degree se-

    quence d1 ... dn0 (n 3) if and only if there exists one with degreesequence d2 1, . . . , dd1+1 1, dd1+2, . . . , dn.

    Theorem 2 (Erdos-Gallai) Letd1 d2 ...... dn > 0 be integers. Thenthey are the degree sequence of a simple graph if and only if(i) d1 + ... + dn is even(ii) for all k = 1,...,n 1 we have

    ki=1 di k(k 1) +

    ni=k+1 min{k, di}.

    Note that Theorem 1 provides an algorithm to generate an actual graph withthe given degree sequence d while Theorem 2 is only an existence result.

    In the following we will imagine the given degree sequence as a collection ofstubs: at each vertex i there are di edges, anchored at the vertex, but the otherends are free. Connecting two stubs at two distinct nodes will form an edgebetween those nodes. During our procedure we will call the residual degreethenumber of current stubs of a node.

    The Havel-Hakimi (or HH-)algorithm for constructing a graph realizing agraphical sequence d works as follows: connect all stubs of the node with thelargest residual degree to nodes that have the next largest residual degreesand repeat until no stubs are left. It is easy to see that the HH-algorithmcan not create all simple graphs realizing the sequence, instead it creates a

    graph in which high degree nodes tend to be connected to other high de-gree nodes. Even the generalized HH-algorithm (GHH-algorithm for short),see the paper by Mihail and Vishnoi [4] (which says that during the proce-dure we can choose any node - not just the one with the maximum residualdegree - as long as we connect all its stubs to the other nodes with the largestresidual degrees) cannot do that. To see that, consider the graphical sequenced = {3, 3, 2, 2, 2, 2, 2, 2}.

    2

    3 2 2 3

    2

    2 2

    Fig. 1. This graph cannot be obtained by the generalized Havel-Hakimi procedure.The integers indicate node degrees.

    If the first node to connect is a node with degree 3, then the GHH-algorithmconnects it to the other node with degree 3 (highest degree). If the first nodeto connect is one with degree 2, then GHH-algorithm connects both its stubsto nodes with degree 3. However, the graph in Fig. 1 does not have any of the

    2

  • 7/27/2019 On realizing all simple graphs with a given.pdf

    3/6

    connections just mentioned (a 3 3 or 3 2 3 connection).

    In this note we prove a slight generalization of the generalized Hakimi-Haveltheorem, which, however, it provides us with an algorithm to construct allsimple graphs realizing a given graphical sequence d. We start with an informal

    version of our main result (Theorem 6):

    Generalized Hakimi - Havel theorem with constraints: Letd = {d1, d2,. . . , dn}, be a non-increasing, non-negative graphical sequence and let j be a

    fixed, but arbitrary vertex. Assume we are given a set of forbidden connectionsinV for nodej. Then there exists a realization of the degree sequence avoidingall forbidden connection if and only if there also exists a realization where j isconnected with vertices of highest degree among the not forbidden ones. (Withother words: one can choose the neighbors of j greedily.)

    To give a formal treatment we start with some definitions and observations:

    Definition 1 Let A(i) be an increasingly ordered set of di distinct nodes as-sociated with node i: A(i) = {ak | ak V, ak = i, k, 1 k di}.

    Usually, this set will represent the set of nodes adjacent to node i in somegraph G, therefor we will refer to A(i) as an adjacency set of i.

    Definition 2 If for two adjacency sets A(i) = {. . . , ak, . . .} and B(i) ={. . . , bk, . . .} we have ak bk for all 1 k di, we say that A(i) B(i).

    Definition 3 Let d1 d2 dn 1 be a graphical sequence, and letA(i) be an adjacency set of node i. The degree sequence reduced by A(i) isdefined as:

    dk

    A(i)

    =

    dk 1 if k A(i)

    dk if k [1, n] \ (A(i) {i})

    0 if k = i

    IfA(i) is the set of adjacent nodes to i in the graph G, then the reduced degree

    sequence dA(i) is obtained after removing node i with all its edges from G.

    Lemma 3 Let {d1, . . . , dj, . . . , dk, . . . , dn} be a non-increasing graphical se-quence and assume dj > dk. Then the sequence {d1, . . . , dj 1, . . . , dk +1, . . . , dn} is also graphical (not necessarily ordered).

    Proof. Since dj > dk, there exists a node m connected to node j, but notconnected to node k. Lets cut edge (m, j) and remove the disconnected stub of

    3

  • 7/27/2019 On realizing all simple graphs with a given.pdf

    4/6

    j. If we add one more stub to k, and connect this new stub to the disconnectedstub of m, then we can see that the new graph is also simple with degreesequence {d1, d2, . . . , dj 1, . . . , dk + 1, . . . , dn}. 2

    Lemma 4 Let d = {d1, d2, . . . , dn}, be a non-increasing graphical sequence,

    and let A(i), B(i) be two adjacency sets for node i V (which is otherwisearbitrary), such thatB(i) A(i). If the degree sequence d

    A(i)

    reduced by A(i)

    is graphical, then the degree sequence dB(i)

    reduced by B(i) is also graphical.

    Proof. Let A(i) = {. . . , ak, . . .} and B(i) = {. . . , bk, . . .}, k = 1, . . . , di. Con-sider the adjacency set B1(i) = {b1, a2, a3, . . . , adi} (we replaced node a1 bynode b1 a1). Ifb1 = a1 then there is nothing to do, we move on (see below).If b1 < a1 then conditions in Lemma 3 are fulfilled. Namely, b1 < a1 impliesdb1 da1 > da11 and we know that the sequence d

    A(i)

    = {. . . , db1, . . . , da1

    1, . . . , da2 1, . . .} is graphical by assumption. Thus, according to Lemma 3,the sequence {. . . , db1 1, . . . , da1, . . . , da2 1, . . .} is also graphical, that isthe one reduced by the set B1(i). Next, we will proceed by mathematical in-duction. Consider the adjacency set Bm(i) = {b1, . . . , bm, am+1, am+2, . . . , adi}and assume that the degree sequence reduced by it (from d) is graphical. Now,consider the adjacency set Bm+1(i) = {b1, . . . , bm+1, am+2, am+3, . . . , adi} (re-placed am+1 by bm+1). If bm+1 < am+1, Lemma 3 can be applied again sincebm+1 < am+1 implies dbm+1 dam+1 > dam+1 1, showing that the sequence re-duced by Bm+1(i) is also graphical. The last substitution (m + 1 = di) finishesthe proof. 2

    Definition 4 Letd = {d1, d2, . . . , dn} be a non-increasing graphical sequenceand m an arbitrarily fixed integer with 0 m n 1 di. For an arbitrarynodei V fix a set of nodesX(i) = {j1, . . . , jm} V \ {i}. Let the setL(i) ={l1, . . . , ldi} contain the di lowest index nodes not in X(i) and different fromi. We call L(i) the leftmost adjacency set of i restricted by X(i). Accordingly,we call the set of nodes X(i) the set of forbidden connections for i.

    Lemma 5 If d = {d1, d2, . . . , dn} is a non-increasing is a graphical sequence,and Y(i) = {y1, . . . ydi} is an adjacency set disjoint from X(i) {i}, thenL(i) Y(i).

    Proof. This follows immediately, since by Definition 4, lj yj, for all j ={1, . . . , di}. 2We are now ready for the main theorem:

    Theorem 6 Let d1 d2 . . . dn 1 be a sequence of integers and foran arbitrary node i V define a set X(i) = {j1, . . . , jm} V \ {i} withm n 1 di and consider L(i), the leftmost adjacency set of i restricted byX(i). Then the degree sequence d = {d1, . . . , dn} can be realized by a simple

    4

  • 7/27/2019 On realizing all simple graphs with a given.pdf

    5/6

    graph G(V, E) in which (i, j) E, for all j X(i), if and only if the degreesequence reduced by L(i) is graphical.

    Proof. = is immediate: add node i to the reduced set of nodes linking itto the nodes in the set L(i), and we have obtained a graphical realization of

    d in which there are no connections between i and any node in X.= In this case d is graphical with no links between i and X(i), and wehave to show that the sequence obtained from d by reduction via L(i) is alsographical. However, d graphical means that there is an adjacency set A(i)(with A(i) X(i) = ) containing all the nodes that node i is connected to inG. Thus, according to Lemma 5, we must have L(i) A(i). Then, by Lemma4, the sequence reduced by L(i) is graphical. 2

    Corollary 7 (Generalized Havel-Hakimi theorem) Letd1 d2 . . . dn 1 be a sequence of integers andi be an arbitrary node inV. Then, the degreesequence {d1, . . . , dn} is graphical if and only if the degree sequence reduced by

    L(i) is graphical.

    Let the set of forbidden nodes be the empty set, X(i) = . In this case L(i) ={1, 2, . . . , di} if i > di or L(i) = {1, 2, . . . , i 1, i + 1, . . . , di + 1} when i di.Thus, according to the corollary, d is graphical if and only if{d1 1, . . . , ddi 1, ddi+1, . . . , di1, di+1, . . . , dn} is graphical when i > di, or {d1 1, . . . , di1 1, di+1 1, . . . , ddi+1 1, ddi+2, . . . , dn} is graphical when i di. 2

    Theorem 6 provides us with a procedure that allows for the construction ofall graphs realizing the same degree sequence. Consider a graphical degree

    sequence d on n nodes. Certainly, we can produce all graphs realizing thissequence by connecting all the stubs of a chosen node first, before moving onto another node with stubs to connect.

    In this vein, choose a node i and connect one of its stubs to some other nodej1. Is the remaining degree sequence d

    = {d1, . . . , di 1, . . . , dj1 1, . . . , dn}still graphical such that nodes i and j1 avoid another connection? Theorem6 answers this question with d as d and X(i) = {j1}. To test whether thesequence reduced by the corresponding L(i) is graphical we can employ anyone of the Theorems 2 or 1. If the test fails on the reduced sequence, onemust disconnect i from j1 and reconnect it somewhere else. If, however, the

    remaining degree sequence is graphical with the constraint imposed by X(i),we connect another stub of i to some other node j2 (different from j1). Thegraphical character of the original sequence guarantees that there is alwaysa j1 where the test (Erdos-Gallai or Havel-Hakimi) will not fail. To checkwhether after the second connection the remaining sequence is still graphicalwith the constraint imposed by the new set X(i) = {j1, j2} we proceed inexactly the same way, using Theorem 6, repeating the procedure until all thestubs are connected away into edges. If the nodes and stubs to connect are

    5

  • 7/27/2019 On realizing all simple graphs with a given.pdf

    6/6

    chosen uniformly at random, this procedure will result in a truly random,uniformly sampled graphical realization of the sequence.

    References

    [1] P. Erdos - T. Gallai: Graphs with prescribed degree of vertices (Hungarian),Mat. Lapok11 (1960), 264274.

    [2] S.L. Hakimi: On the realizability of a set of integers as degrees of the verticesof a simple graph. J. SIAM Appl. Math. 10 (1962), 496506.

    [3] V. Havel: A remark on the existence of finite graphs. (Czech), Casopis Pest.Mat. 80 (1955), 477480.

    [4] M. Mihail- N. Vishnoi: On Generating Graphs with Prescribed Degree

    Sequences for Complex Network Modeling Applications, Position Paper,ARACNE (Approx. and Randomized Algorithms for CommunicationNetworks), Rome (2002).

    6