Minimal Bases of Outerplanar Graphs

Josef Leydold Peter F. Stadler

SFI WORKING PAPER: 1998-01-011

SFI Working Papers contain accounts of scientific work of the author(s) and do not necessarily represent the views of the Santa Fe Institute. We accept papers intended for publication in peer-reviewed journals or proceedings volumes, but not papers that have already appeared in print. Except for papers by our external faculty, papers must be based on work done at SFI, inspired by an invited visit to or collaboration at SFI, or funded by an SFI grant.

©NOTICE: This working paper is included by permission of the contributing author(s) as a means to ensure timely distribution of the scholarly and technical work on a non-commercial . Copyright and all rights therein are maintained by the author(s). It is understood that all persons copying this information will adhere to the terms and constraints invoked by each author's copyright. These works may be reposted only with the explicit permission of the copyright holder. www.santafe.edu

SANTA FE INSTITUTE

Minimal Cycle Bases of Outerplanar Graphs

a bc

Josef Leydold and Peter F Stadler

a

Dept for Applied Statistics and Data Pro cessing

University of Economics and Business Adminstration

Augasse A Wien Austria

Phone Fax EMail JosefLeydoldwuwienacat

URL httpstatistikwuwienacatstaffleydold

b

Institut fur Theoretische Chemie Universitat Wien

Wahringerstrae A Wien Austria

Phone Fax EMail studlatbiunivieacat

Address for corresp ondence

c

The Santa Fe Institute

Hyde Park Road Santa Fe NM USA

Phone Fax EMail stadlersantafeedu

URL httpwwwtbiunivieacatstudla

Abstract

connected outerplanar graphs have a unique minimal cycle basis with length

jE j jV j They are the only Hamiltonian graphs with a cycle basis of this length

Keywords Minimal Cycle Basis Outerplanar Graphs

AMS Sub ject Classication C D

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Intro duction

The description of cyclic structures is an imp ortant problem in

see eg Cycle bases of graphs have a variety of applications in science

and engineering among them in structural analysis and in chemical structure

storage and retrieval systems Naturally minimal cycles bases are of particular

practical interest

In this contribution we prove that outerplanar graphs have a unique minimal

cycle basis This result was motivated by the analysis of the structures of biop oly

mers In addition we derive upp er and lower b ounds on the length of minimal cycle

basis in connected graphs

Biop olymers such as RNA DNA or proteins form welldened three dimen

sional structures These are of utmost imp ortance for their biological function

The most salien t features of these structures are captured by their contact graph

representing the set E of all pairs of monomers V that are spatially adjacent While

this simplication of the D shap e obviously neglects a wealth of structural details

it encapsulates the typ e of structural information that can b e obtained byavariety

of exp erimental and computational metho ds Nucleic acids b oth RNA and DNA

form a sp ecial typ e of contact structures known as secondary structures These

graphs are sub cubic and outerplanar

A particular typ e of cycles which is commonly termed lo ops in the RNA litera

ture plays an imp ortant role for RNA and DNA secondary structures the energy

of a secondary structure can be computed as the sum of energy contributions of

the lo ops These lo ops form the unique minimal cycle basis of the contact graph

Exp erimental energy parameters are available for the contribution of an individual

lo op as a function of its size of the typ e of b onds that are contained in it and on

the monomers nucleotides that it is comp osed of Based on this energy mo del

it is p ossible to compute the secondary structure with minimal energy given the

sequence of nucleotides using a dynamic programming technique

Preliminaries

In this contribution we consider only nite simple graphs GV E with vertex set

V and edge set E ie there are no lo ops or multiple edges GV E is connected

if the deletion of a single vertex do es not disconnect the graph

Let G V E andG V E betwo subgraphs of a graph GV E We shall

  

write G n G for the subgraph of G induced bythe edge set E n E

 

The set E of all subsets of E forms an mdimensional over GF

ultiplication X X with vector addition X Y X Y n X Y and scalar m

X for all X Y E A cycle is a subgraph such that anyvertex is even

We represent a cycle by its edge set C Sometimes it will b e convenient to regard

C as a subgraph V C of GV E The set C of all cycles forms a subspace of

C

E which is called the of G A basis B of the cycle space C is called

a cycle basis of GV E The dimension of the cycle space is the cyclomatic

number or rst Betti number GjE jjV j

It is obvious that the cycle space of graph is the direct sum of the cycle spaces

of its connected comp onents It will be sucient therefore to consider only

connected graphs in this contribution

A connected or elementary cycle is a cycle C for which V C is a connected

C

minimal subgraph suchthatevery vertex in V has degree Wesay that a cycle C

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

basis is connected if all cycles are connected A cycle C is a chord less cycle if

V C is an induced subgraph of GV E ie if there is no edge in E n C that is

C

incidenttotwovertices of V We shall say that a cycle basis is chordless if all its

C

cycles are chordless

The length jC j of a cycle C is the numberofitsedges The length B of a cycle

P

basis B is sum of the lengths of its cycles B jC j A minimal cycle basis

C B

is a cycle basis with minimal length Let cB b e the length of the longest cycle in

the cycle base B Chickering showed that B is minimal if and only if cB is

minimal ie a cycle basis is minimal if and only if has a shortest longest cycle

A cycle C is relevant ifitiscontained in a minimal cycle basis Vismara

proved the following

Prop ostion A cycle C is relevant if and only if it cannot be represented as a

sum of shorter cycles

An immediate consequence is

Corollary Arelevant cycle is chordless Hence a minimal cycle basis is chord

less and of course connected

Fundamental Cycle Bases

In what follows let GV E b e a connected graph

Supp ose T is a spanning of G Then for eachedge T there is unique

cycle in T fg which is called a fundamental cycle The set of fundamental cycles

b elonging to a given form a basis of the cycle subspace which is called

the fundamental basis wrt T For details see A collection of G cycles in

G is called fundamental if there exists an ordering of these cycles suchthat

C n C C C for j G

j  j

Of course such a collection is a cycle basis Not all cycle bases are fundamental

Lemma An elementary fundamental cycle basis can beordered such that

i C is an elementary cycle and

ii C n C C P is a nonempty path for j G

j j j

Proof Let G C C Then G G for i and consequently

i i i i

G G G G G G Therefore

G G

equality holds and wehave G iieB fC C g is a cycle basis for G

i i i i

Next notice that there exists an ordering for which holds such that G is

i

Otherwise there exists a j such connected for all i ie C G

i i

that C G for all C BnB for all orderings satisfying But then

j j

C C has emptyintersection with G C C a contradiction

j j j

G

since G C C is connected G is connected since by assumption all

i

G

C are connected

j

An immediate consequence is that C n G must b e either a path as claimed

j j

or an elementary cycle with has one vertex in common with G Otherwise we

j

G j If C n G is a cycle this one vertex must b e a vertex would have

j j j

of G Then there must be a cycle C BnB which has at least one edge in

j k j

common with G and with P Otherwise G cannot be connected Then we

j j

can reorder the basis by exchanging C and C

j k

Aweaker result holds for nonfundamental cycle bases

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Lemma Any connected nonfundamental cycle basis can be ordered such that

C C is connected for al l i

i

Proof Analogously to the pro of of lemma second part we can show that all

G C C are connected

i i

If B is a nonfundamental cycle basis of G then there is subgraph G with cycle

basis B B such that eachedgeofG is contained in at least two cycles of B

prop Furthermore the examples of nonfundamental bases in are much

longer than the minimal cycles bases One might b e tempted therefore to conjecture

that every minimal cycle basis is fundamental Although this statement is easily

veried for planar graphs see corollary it is not true in general Consider the

complete graph K with vertices It is straightforward we used Mathematica



to checkthat the following cycles are indep endent and thus are a basis of the

cycle space since K



Here denotes the cycle fv v v v v v g This basis is minimal

   

since every cycle has length But it is nonfundamental since every edge is cov ered

at least two times

Outerplanar Graphs

A graph GV Eisouterplanar if it can b e emb edded in the plane such that all

vertices lie on the b oundary of its exterior region Given suchanemb edding wewill

refer to the set of edges on the b oundary to the exterior region as the boundary B

of G A graph is outerplanar if and only if it do es not contain a K or K minor

 

An algebraic characterization in terms of a sp ectral invariantis discussed in

Lemma An GV E is Hamiltonian if and only if it is

connected

Proof A Hamiltonian graph is always connected Supp ose G is outerplanar

connected but not Hamiltonian connectedness implies that there is no cutedge

Thus the b oundary B of G is a closed path containing an edge at most once A

vertex x that is incident with more than edges of B must b e a cutvertex of G since

it partitions B into at least two edgedisjoint closed paths B and B Let V and

V the vertices incident with the edges in B and B resp ectively Outerplanarity

implies that there are no edges connecting a vertex y V nfxg with a vertex

z V nfxg Thus x is a cut vertex contradicting connectedness

Lemma A connected outerplanar graph GV E contains a unique Hamilton

ian cycle H

Proof If G is a cycle graph there is nothing to show Otherwise denote by H

the Hamiltonian cycle forming the b oundary of G and consider an arbitrary edge

H By construction G is emb edded in the plane such that p q divides G

into two subgraphs G and G with vertex sets V and V satisfying jV jand

  i

V V fp q g Now consider twovertices x V nfp q g and y V nfp q g Since

 

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

G is outerplanar each path from x to y passes through p or q Each connected

cycle containing b oth x and y therefore consists of two disjoint paths one of which

passes only through p while the other one passes only through q Thus the edge

p q cannot be part of any connected cycle containing both x and y Thus G

contains no Hamiltonian cycle dierent from H

As a consequence there is a unique partition of the edge set E of an outerplanar

graph G into the Hamiltonian cycle H and the set of chords K E n H It

will b e convenient to lab el the vertices such that the edges in H are i i for

n andn Without lo osing generalitywemay assume that n is a

vertex of degree

It will b e useful to intro duce the following partial order on K

i j i j if and only if i i j j and

We say that is interior to If there is no K such that we

say that is immediately interior to For each alpha in K we set

Y f K j g Y denotes the set of maximal elements in K ie the

set of contacts that are not interior to any other contact Yans bambooshoot

graphs are exactly those outerplanar graphs for whichK is an ordered set

Nucleic acids both RNA and DNA form a sp ecial typ e of contact structure

known as sec ondary structure A graph GV E with V fng is a secondary

structure if it satises

i The socalled backb one T fi i j ing is a subset of E

ii For each i V there is at most one contact E n T incidentwithi

iii If i j k l E n T and ik j then il j

The contacts in nucleic acids are usually called base pairs Note that the backb one

T is a spanning tree of G

Lemma Agraph GV E isasecondary structuregraph is connected outerpla

nar and subcubic

Proof By prop erties i and ii it is clear that a secondary structure graph is sub

cubic Prop erty iii implies that when the vertices are arranged along a circle then

one maydraw the chord E n T in the interior of this circle without intersection ie

G is outerplanar This is a common representation for drawing RNA secondary

structures

The converse is not true since outerplanar sub cubic graphs do not necessarily have

unbranched spanning trees T

Minimal Cycle Bases of Outerplanar Graphs

Let G V be a connected outerplanar graph The set T H nfng is

a spanning tree of GV E The fundamental basis F of the cycle space wrt T

therefore consists of the uniquely determined cycles F in T fg K and the

Hamiltonian cycle H T fng We dene

M M

H C F F and C F

Y Y

Furthermore we set M fC j K g fC g

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Theorem Let GV E be a connected and outerplanar graph Then M is the

unique minimal cycle basis of G

Proof Consider an edge K suchthat Y that is a minimal element of the

p oset K We observe that F C in this case

Let G be the graph obtained from G by deleting the edges F nfg and all

vertices that are isolated as a consequence It is clear that G is again a connected

outerplanar graph Its b oundary is the Hamiltonian cycle H H C The

set of chords of G is K K nfg The fundamental basis F of G wrt

T H nfng consists of H and the cycles F K which are obtained

by the rule F F C if and F F if Furthermore wehave

Y Y n and F C if and only if Y

Consider an arbitrary cycle basis B of G We can construct a cycle base B of G

from B that consists of C and a cycle basis B of G by the following pro cedure

For each Z B we dene Z Z if Z C or if Z C fg otherwise we

set Z Z C Z n C fg Wehave to distinguish three cases

i C B and Z Z for all other cycles Then B B B fC g and

B B jC j

ii C B but there is at least one cycle Z B satisfying Z Z The length

of this cycle is jZ j jZ jjC j jZ j ie B B

iii C B Then there is at least one cycle Z Z and all Z are nonempty

Since C is indep endentofallZ there must b e at least on dep endent cycle

in the set fZ jZ Bg whichmust b e removed in order to obtain the basis

B The length of this cycle is of course at least Thus

B B jC jjZ j jZ jB jC jjC j B

That is B is strictly shorter than B in this case as well

Thus if B is a minimal cycle basis of G then cases ii and iii cannot o ccur ie

a minimal cycle basis of G consists of C and a minimal cycle basis B of G

Rep eating this argument jK j times shows that eachcycleC K must b e

contained in any minimal cycle basis of G The remainder G of G after all cycles

C K are removed by the ab ove pro cedure is comp osed of Y and those edges

of H that are not contained in any of the cycles C The edge set of G is the

chordless cycle C Thus fC gfC j K g M is therefore the only minimal

cycle basis of

Let GV E b e a and let fQ g b e the collection of faces in a given

j

emb edding in the plane EachfaceQ uniquely denes the cycle Q which forms

j j

its b oundary The collection of cycles fQ g j G is a cycle basis of G

j

Any cycle basis obtained in this wayiscalleda planar cycle basis

It is natural to ask whether every planar graph has a minimal cycle basis that

is also planar The answer to the question is negative in general as gure shows

Corollary M is planar cycle basis with length MjE jjV j

Proof The cycle basis M is the planar basis obtained byemb edding G in sucha

way in the plane that the Hamiltonian cycle H b ecomes the outer b oundary By

Using jH j jV j and jK j jE jjV j construction wehave MjH j jK j leads to the desired result

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Figure Hamiltonian planar graph with a nonplanar minimal

cycle basis It is easy to verify that this graph has no planar em

b edding with the face Q A minimal cycle basis con

tains Q and two of the cycles

and Hence M while the planar bases have

M

In the following we state an algorithm for nding this unique minimal cycle

our investigation is motivated by RNA sec basis for a outerplanar graph Since

ondary structures we assume that the backb one of the outerplanar graph ie the

Hamiltoniancycle is already given Algorithm uses corollary to compute the

minimal cycle base As can easily b e seen this algorithm is of order O jV j To

show that it really delivers the planar and unique minimal cycle basis one can

draw the f ng as straight line add all contacts and edge

nabove this line in suchaway that no twoofthemhave common p oints not

on the line

algorithm nd minimal cycle basis of outerplanar graphs

Input adjacency matrix Hamiltonian cycle f ng

for all vertices i i n do

k i

for all edges i k i k k do

j 

pop edge i k fromstack This do es not work if G is not outerplanar

j

if ki then

add cycle fi i i i k k k ig to cycle basis

j j j

else

add cycle fi k k k k k k ig to cycle basis

j j j

k k

j

for all edges i k n k k i do

j 

push edge i k onstack

j

It is interesting to note that the fundamental basis F can b e easily expressed in

terms of the minimal cycle basis M

ii h i h h

L L L

F F C F C C

Y Y Y

h h h iii

L L L

C F C C

Y Y Y

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

The expansion eventually stops if Y and hence F C Clearly the nested

sums contain each b ond in W f K j g the set of contacts interior to

and itself exactly once Therefore wehave

M

F C

W fg

Analogously one nds

M M

F C C C H

K Y

Upp er Bounds on min B

In theorem an upp er b ound for the length of a minimal cycle basis M of

an arbitrary graph GV E is given

M jV jjV j

While this b ound is sharp for complete graphs it can b e improved substantially

for planar graphs

First we need the following simple observations

Prop ostion Let GE V be a connectedgraph Then

jE j jV j if G is planar

jE j jV j if G is outerplanar

These bounds are sharp for al l jV j

The result on planar graphs is an immediate corollary of Eulers formula for

p olyhedra The upp er b ound on outerplanar graphs follo ws from a theorem by

GA Dirac stating that for any graph not containing K as a minor we have



jE jjV j

Abamb o osho ot graph consisting of n triangles has n n vertices and

n n edges Consider the graph G recursively obtained byaddinga

n

vertex n which is connected to the three vertices lab eled n and of G

n

We set G K the cycle of length It is obvious that these graphs are all

 

planar and G has edges and vertex more than G Thus G has n vertices

n n n

and n n edges

We can translate the ab ove result into upp er b ounds for the lengths of a minimal

cycle bases that dep end only on the number of vertices

Theorem Let GE V be a connected planar graph with a minimal cycle

base M Then

M jV j if G is planar

M jV j if G is outerplanar

Proof Analogously to the pro of of lemma we nd for the planar case M

V j jV j by as claimed Similarly for the outer jE j j

planar case MjE jjV j jV j jV j jV j whichis

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Figure A Hamiltonian planar graph for which inequality is sharp

It is not p ossible to improve the b ound for planar Hamiltonian graphs see

m

the example in gure Similar examples for jV j can b e constructed by

the following recip e

m

Makea gon

m

Insert center as additional vertex c and add edges c ifor i

Insert edges

Insert edges and so on

Lemma Let GV E be a connected planar graph Then M jE jg G

where g G denotes the girth of G

Proof A planar cycle basis contains eachinterior edge t wice while the edges of

the outer b oundary app ear only once The length of the outer b oundary is at least

g G

As an immediate consequence wehave

Corollary Every minimal cycle basis of a planar graph is fundamental

Proof Supp ose B is not fundamental By prop we can assume that every

edge is covered by at least two edges Thus B jE j But since every planar

cycle basis has length B jE j by lemma the prop osition follows

Lower Bounds on B

Theorem Let GV E beaconnectedgraph and B a cycle basis of G Then

B jE jjV j

Equality holds for a minimal cycle basis B if and only if for every vertex v V the

number of cycles c B through v is d where d denotes the degreeof v

v v

Proof Let S denote the graph induced by all edges incident to v S is a star

v v

of diameter with d edges The edge set E of S with the addition forms

v v v

a d dimensional vector space Let S denote its sub space where each element

v v

consists of an even numb er of edges As can easily b e veried dimS d

v

Let C denote the vector space fC S C Eg It is obvious that C S

v v v v

Moreover for all C C that consists of exactly edges there exists a C E with

v

C C S and thus C S Otherwise every cycle C in G has vertex v as double

v v v

point and hence v was a cut vertex of G a contradiction to G b eing connected

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Therefore C S is spanned by B fC S C BC S g Conse

v v v v v

quently jB jdimS d and B d since every C B contains at

v v v v

P

least two edges Notice that jE j d every edge is incidenttovertices

v

v V



P

B every edge is contained in the stars S and B centered at two

v v

i

v V



vertices v and v Hence wend



X X

B d jE jjV j B

v v

v V v V

ie inequality Equality holds if and only if B is a basis of S Thus the

v v

statement follows

Theorem Let GV E be a connectedgraph with a minimum cycle basis B

Then B jE jjV j if and only if B is a fundamental cycle basis such that

jC C C j for al l i G ie consists of exactly one edge

i i

Proof By corollary B is elementary By lemmata and we can order the cycle

basis suchthat C C is connected Thus C C C consists of

i i i

at least one edge

Let GjE jjV j Let E denote the edge set of G and let V and V C

i i i j

denote the vertex sets of G and C resp ectively Then wend

i j

G jE jjV j

i i i

jE j jC jjE C j jV j jV C jjV V C j

i i i i i i i i

jE jjV jjC jjV C j jE C jjV V C j

i i i i i i i i

G jC jjE C j

i i i i i

since jC j jV C j and jV V C j jE C j where denotes the

i i i i i i i i

numb er of connected comp onents ie paths in C n E Notice that the number

i i

of comp onents in C E if and otherwise since C is elementary

i i i i i

Thus jE C j and

i i i

G G jC j

i i i

Equality holds if and only if jE C j

i i i

Let B fC C g Wehave B jC j jE jjV j G sinceC

i i

is an elementary cycle By induction wethennd B G jE jjV j

i i i

B B jC jG jC jG

i i i i i i

Equality holds if and only if all E C If B is fundamental then

i i i i

for all i by lemma and E C is a single edge for all i as claimed If B

i i

is not fundamental than we always have an j such that C E and thus

j j

jE C j jC j Thus B G

j j j j j j

In the following we derivesomeweaker conditions for which is sharp

Lemma Let GV E be a connectedgraph If B jE jjV j for a cycle

base B then G is planar

Proof If equality holds in equ then B is elementary and fundamental bytheo

rem Then there exists an ordering of B as describ ed in lemma By theorem

every cycle C has exactly one edge in common with C C Thus by in

i i

duction we can add the ear P from C into the planar drawing of C C

i i i

for all i

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

Lemma Let GV E be a Hamiltonian graph Then there exists a cycle basis

B for which B jE jjV j holds if and only if G is outerplanar

Proof By corollary a minimal cycle basis of an outerplanar graph has length

jE jjV j

If equality holds in equ then G is planar lemma and B is fundamental

theorem Moreover B can be ordered such that every cycle C has exactly

i

one edge in common with C C Obviously H C is Hamiltonian cycle in

i

C Then by induction H H C is a Hamiltonian cycle in C C

i i i i

Furthermore we can draw the ears P of the cycles C lemma into the

i i

outside of C C Thus H is the b oundary to the exterior region of G and the

i i i

prop osition follows by induction

Figure NonHamiltonian planar graph for which equality holds

in lemma

The condition Hamiltonian in lemma cannot b e relaxed An example of a

planar nonHamiltonian graph with B jE jjV j is shown in gure

References

G Chartrand and F Harary Planar permutation graphs Ann Inst Henri Poincare B

WK Chen On vector spaces asso ciated with a graph SIAM J Appl Math

D M Chickering D Geiger and D Heckerman On nding a cycle basis of with a shortest

maximal cycle Inform Processing Let

Y Colin de Verdiere Sur un novel invariant des graphes et un critere de planarite J Comb

Theory B

N Deo G M Prabhu and M S Krishnamo orty Algorithms for generating fundamental

cycles in a graph ACM Trans Math Software

G A Dirac In abstrakten Graphen vorhandene vollst andige Graphen und ihre Unterteilun

gen Math Nachr

G M Downs V J Gillet J D Holliday and M F Lynch Review of p erception

algorithms for chemical graphs J Chem Inf Comput Sci

S M Freier R Kierzek J A Jaeger N Sugimoto M H Caruthers T Neilson and D H

Turner Improved freeenergy parameters for predictions of RNA duplex stability Proc Natl

Acad Sci USA

D Hartvigsen and E Zemel Is every cycle basis fundamental J Graph Theory

J D Horton A p olynomialtime algorithm to nd the shortest cycle basis of a graph SIAM

J Comput

J Leydold P F Stadler Minimal Cycle Bases of Outerplanar Graphs

A Kaveh Structural Mechanics Graph and Matrix Methods Research Studies Press Exeter

UK

M Plotkin Mathematical basis of ringnding algorithms in CIDS J Chem Doc

K Thulasiraman and M N S Swamy Graphs Theory and Algorithms J Wiley Sons

New York

P Vismara Union of all the minimum cycle bases of a graph Electronic J Comb R

pages

HJ Voss Cycles and Bridges in GraphsKluwer Dordrecht

M S Waterman Secondary structure of singlestranded nucleic acids Adv Math Suppl

Studies

H Whitney On abstract prop erties of linear dep endence Am J Math

L Yan A family of sp ecial outerplanar graphs with only one triangle satisfying the cycle

basis interp olation prop erty Discr Math