modern computer and communications networks constitute an arena of economic interactions among multiple autonomous self - interested entities ( network access providers , end - users , electronic commerce enterprises , content storage and distribution enterprises ) .
the internet is perhaps the most massive and global field where economic networking interactions take place .
the recently established study of _ network formation games _  @xcite(chapter 19 ) aims at understanding how the competitive ( or coalitional ) activity of multiple such _ selfish agents _ affects the network s characteristics and its efficiency . in this paper
we consider the setting of @xmath0 _ content distribution network _
enterprises interacting over a network .
enterprise @xmath7 takes decisions on where to store replicas of digital content over the network , so as to satisfy access demand of local customers , situated at node @xmath8 .
demand is expressed by a non - negative weight @xmath9 for enterprise @xmath7 .
every enterprise chooses strategically a location @xmath10 on the network for installation of content replicas , so as to minimize its individual expenses for _ ( a ) _ storage / management of the content , and _ ( b ) _ weighted connection ( bandwidth / delay ) costs to the chosen location .
we study a _ facility location _
game played among selfish agents ( enterprises ) , that naturally models this situation .
we use a fair cost allocation rule - known as shapley cost - sharing  @xcite - for facility installation costs : for a location @xmath10 installation cost @xmath11 is shared in a fair manner among agents that receive service from @xmath10 , so that agent @xmath7 pays @xmath12 , where @xmath13 denotes the total demand forwarded to @xmath10 .
the weighted connection cost is given by @xmath14 , where @xmath15 denotes connection cost per unit of demand .
our work focuses on bounding the _ social cost _ of cost - efficient and _ stable _ network infrastructures ; stable networks will be represented by _
pure _ strategy nash equilibria and _ strong _ equilibria of the corresponding facility location game .
the social cost will be the sum of individual costs experienced by the agents - players of the game .
strong equilibria are an extension of pure nash equilibria , dicussed in  @xcite , and essentially introduced by aumann in  @xcite .
strong equilibria are resilient to coalitional _ pure _ deviations : a strategy profile is a strong equilibrium if no subset of agents can deviate ( by jointly adopting a different _ pure _ strategy ) , so that all of its members are better off .
thus this notion captures the possibility of coalitional behavior among agents .
occurence of such behavior is naturally expected in rapidly evolving modern markets , especially the ones involving the exploitation and exchange of digital goods and services .
we derive bounds on the _ price of stability _
( pos ) of pure equilibria , defined as the cost of the least expensive equilibrium relative to the socially optimum cost  @xcite . for strong equilibria
we derive bounds on their ( strong ) _ price of anarchy _ ( spoa ) , i.e. the cost of the most expensive strong equilibrium relative to the socially optimum cost .
let us note that the _ price of anarchy _ of pure nash equilibria was introduced in  @xcite as the cost of the most expensive pure nash equilibrium relative to the socially optimum cost , and measures essentially social cost losses incurred due to selfishness of agents , _ and _ lack of coordination among them .
the pos on the other hand measures social cost losses only due to selfishness : if all players coordinate ( even by following some externally provided instructions , or by interacting on the basis of a common protocol ) they may reach the least expensive equilibrium .
the notion of strong equilibria inherently permits coordination among subsets of agents .
therefore we can intuitively expect the spoa to almost match the pos .
our results confirm this intuition .
the study of the price of stability in network design games with fair allocation of network link costs was initiated in  @xcite .
one challenging problem remaining open since then is improving upon an upper bound of @xmath16 and a lower bound ( recently shown in  @xcite ) of @xmath17 , for unweighted players on undirected networks .
a series of recent works  @xcite provides results ( polylogarithmic upper bounds ) with respect to the social cost of pure nash and ( approximate ) strong equilibria in the network design game model of  @xcite , also for the case of weighted players .
we review these results in section  [ section : related - work ] .
we also explain how the facility location game that we study is a special case of the more general model introduced in  @xcite , that also includes _
`` delay '' _ costs in using network links ( refered to as connection costs in the case of facility location ) , apart from fairly allocated _ `` installation '' _ costs . for the case of metric connection costs we were able to prove greatly improved and almost tight bounds for the pos and the spoa ; this makes the _ metric _ facility location game and exceptional special case of the model introduced in  @xcite .
[ [ summary - of - results ] ] summary of results + + + + + + + + + + + + + + + + + +    we analyze the pos of the unweighted metric facility location game ( section  [ section : unweighted - metric - pos ] ) , and prove constant upper and lower bounds .
note that an @xmath1 general upper bound implied by the work of  @xcite is tight for non - metric networks ( we discuss this in section  [ section : definitions ] ) .
our technique relies on direct analysis of social cost evolution during an iterative best response performed by the agents , until they reach equilibrium .
we show in particular that given any initial configuration ( including the social optimum ) , the social cost of the reached equilibrium is at most @xmath18 times the initial social cost and at least @xmath19 times this cost in the worst case .
metric facility location is the first case of the model proposed in  @xcite , in which an additional structural network property ( triangle inequality ) yields a constant almost tight price of stability .
it is also interesting that incorporation of link delays ( connection costs ) makes the previously derived @xmath20 upper bounds tight for the non - metric unweighted game .
subsequently we study strong equilibria ( section  [ section : apx - strong - equilibria ] ) .
although they do not always exist , we prove that @xmath21-approximate strong equilibria exist ( no subset deviation causes factor @xmath21 improvement to all of its members ) , for @xmath22 in general networks and weighted agents .
for the price of anarchy of approximate strong equilibria ( spoa ) we show an @xmath4 general upper bound which becomes @xmath6 for unweighted agents ( section  [ section : strong - poa ] ) . for the metric unweighted case
we prove a constant upper bound ( section  [ subsection : metric - unweighted - spoa ] ) .    except for the spoa analysis in paragraph  [ subsection : metric - unweighted - spoa ] ( theorem  [ theorem : metric - spoa - ub ] ) , the rest of the described results have appeared in  @xcite , in a shorter version  -approximate strong equilibria that appeared in a previous version of this report was erroneous and has been removed . ] .
we note that the analysis of the spoa of approximate strong equilibria for the metric unweighted case in paragraph  [ subsection : metric - unweighted - spoa ] essentially generalizes the analysis of the corresponding result appearing in  @xcite ( theorem 2 ) ; this result concerned the spoa of exact strong equilibria only _ when _ they exist .
.summary : facility location games with fair allocation of facility costs . [ cols="^,^,^,^ " , ]
anshelevich _ et al . _ first studied the price of stability for network design games with general  @xcite and fair cost allocation  @xcite . in the latter case @xmath0
agents wish to connect node subsets over a network , by strategically selecting links to use .
every network link is associated to two cost components , an _ installation _ cost and a _ delay _ cost .
link installation cost is shared fairly among agents using the same link in  @xcite , while every agent experiences a delay cost given by a polynomial function of the number of agents using the link .
the authors showed that _ for unweighted agents _ these network design games belong to the class of _ potential _ games introduced by monderer and shapley in  @xcite , hence they have pure strategy nash equilibria .
in particular , a potential function defined in  @xcite is associated to these games in the following manner : an arbitrarily initialized iterative best response procedure carried out by the players reaches a local minimum of the potential function , which corresponds to a pure strategy nash equilibrium of the game . in
@xcite the authors developed elegant arguments using the potential function , so as to upper bound the pos for unweighted agents . in case of polynomial delay costs of degree at most @xmath23 the pos was shown to be at most @xmath24 .
for the case of directed networks this bound was shown to be tight ( for k=0 and zero delays ) , whereas for undirected networks a lower bound of @xmath25 was given .
this was recently improved to @xmath17 by fiat et al .
@xcite , who also showed an upper bound of @xmath26 for @xmath27 , when exactly one agent resides on each node of the network and all agents need to connect to a common sink node ( single - sink case ) . for weighted agents a potential function proving existence of pure equilibria
was developed for only @xmath28 agents in  @xcite .
chen et al .
@xcite showed that pure strategy nash equilibria do not always exist for weighted network design games with fair allocation of link installation costs .
they developed a trade - off for the social cost of approximate equilibria versus the approximation factor , as a function of the maximum weight taken over all agents .
an extensive study of _ strong _ equilibria for network design games with fair cost allocation ( but without delays ) appeared recently by albers in  @xcite , for unweighted and weighted agents .
strong equilibria do not always exist , but she showed that @xmath20 and @xmath4-approximate strong equilibria do exist ( @xmath5 is the sum of the agents weights ) for unweighted and weighted games respectively .
she proved @xmath20 and @xmath29 upper bounds for the spoa of approximate strong equilibria which are tight for directed graphs .
for undirected graphs she showed @xmath30 and @xmath31 lower bounds . finally and most importantly , she showed an @xmath32 lower bound for the pos of weighted network design games .
strong equilibria in the context of ( single - sink ) unweighted network design games with fair cost sharing were first studied in  @xcite .
the authors gave topological characterizations for the existence of strong equilibria on directed networks , and proved that @xmath33 .
as of the recent literature , the gap for the identification of the pos of network design games with fair cost allocation remains open for unweighted agents , with the lower bound of @xmath17 being the best known so far , to the best of our knowledge . in effect , this means that the impact of an undirected network structure to the pos is not well understood , since the upper bounding potential function arguments developed in  @xcite do not incorporate network structure .
the facility location game is a special case of the model studied in  @xcite , that is interesting on its own right : it finds numerous applications and exhibits intriguing characteristics .
it emboddies non - shareable delays explicitly and in a sense specializes _ single - sink _ network design considered in  @xcite : we can simply augment the network with a node @xmath34 and set links @xmath35 to have fairly shareable cost , equal to the facility opening cost at @xmath10 .
the original network links have a delay cost only .
then every agent needs to choose at most two edges from the node it resides on , to @xmath34 .
[ [ facility - location - games ] ] facility location games + + + + + + + + + + + + + + + + + + + + + + +     an unweighted metric facility location game with uniform facility costs was studied in the context of _ selfish caching _ in  @xcite . the network model of that work is essentially equivalent to the one we discuss here , apart from the fact that fair cost - sharing of facility costs was _ not _ used : an agent could connect to a facility payed exclusively by another agent .
another difference is that facility opening cost was uniform accross all nodes of the network , whereas we consider node - dependent costs .
the poa and pos of this model were shown to be unbounded .
the authors devised an extension of their game model , with payments exchanged among agents , in which the socially optimum configuration of the original game is rendered a pure strategy nash equilibrium ( hence @xmath36 for the extended game ) .
vetta studied a class of games for _ competitive _ facility location  @xcite , for which he proved existence of pure strategy nash equilibria and an upper bound of @xmath28 for the poa . in this competitive setting enterprises open facilities at certain nodes and try to attract customers to connect to them .
he also illustrated applicability of his model in the context of the @xmath23-median problem model . in
@xcite the authors considered _ single - sink _ network design with fair cost - sharing of all resources ( network links ) used by agents .
they argued how this model can be viewed as a facility location model , but did not take connection costs ( non - shareable delays ) into account .
the network will be a complete graph @xmath37 , each edge @xmath38 of which is associated to a non - negative cost @xmath39 .
we consider a set @xmath40 of @xmath0 agents . each agent @xmath7 resides on a node @xmath41 , and is associated to a non - negative demand weight @xmath9 .
the strategy space of agent @xmath7 is @xmath42 : @xmath7 chooses a location @xmath43 , where it will receive service from . opening a facility at node @xmath43 costs
@xmath11 . a strategy profile ( configuration )
is denoted by @xmath44 , where @xmath45 .
the total weight of agents receiving service from @xmath10 under @xmath46 is @xmath47 .
the cost @xmath48 experienced by agent @xmath7 in @xmath46 is :    @xmath49    every agent @xmath7 pays a fraction @xmath50 of the facility installation cost at @xmath51 .
denote by @xmath52 the set of facility locations specified under @xmath46 . the _ social cost _
@xmath53 is then :    @xmath54    we use @xmath55 for the sum of weights of agents in set @xmath56 . by @xmath57
we denote the total cost of agents in @xmath56 under @xmath46 .
furthermore , given a facility @xmath58 , we use @xmath59 to denote @xmath60 .
* pure nash equilibria * the _ unweighted _ facility location game specializes network design games first studied in  @xcite , and is a potential game  @xcite ; it is associated to a potential function , that can be locally minimized by iterative best response performed by players , and the reached local minimum corresponds to a pure nash equilibrium . in iterative best response
we choose iteratively an arbitrary player @xmath7 , and let him / her decide a strategy that minimizes its individual cost with respect to the current configuration @xmath61 for the rest of the players .
the process ends when no player @xmath7 can improve his / her individual cost under @xmath62 .
then @xmath46 is a pure nash equilibrium .
a simple example shows that the poa of pure equilibria can be @xmath0 in the worst case .
take a network of two nodes @xmath63 . opening a facility on either node
has a cost @xmath64 .
we set @xmath65 , and let @xmath0 agents reside on @xmath66 . then if every agent @xmath7 plays @xmath67 , @xmath68 , the resulting configuration is a pure nash equilibrium of cost @xmath69 , because every agent pays exactly @xmath64 and has no incentive to open a facility at node @xmath66 by paying the same cost @xmath64 .
the social optimum consists of a single facility opened on @xmath66 and all agents being locally serviced by it , at zero connection cost .
thus the socially optimum cost is @xmath64 .
potential function arguments developed in  @xcite yield an upper bound of @xmath70 for the pos , where @xmath70 is the @xmath0-th harmonic number .
this bound is tight for unweighted non - metric facility location .
[ figure : general - pos - lb ] presents a non - metric lower bounding example for unweighted agents .
assume uniform facility costs equal to 1 .
@xmath71 unweighted agents reside on boldly drawn nodes , @xmath0 of them on @xmath72 .
the social optimum consists of facilities on @xmath73 and @xmath72 , where @xmath72 serves only the @xmath0 agents residing on @xmath72 .
the rest are served by @xmath73 .
however they deviate to @xmath72 from @xmath73 one by one .
it is then : @xmath74 .
when it comes to metric networks however , the pos is constant as we show in the following section .
this result essentially indicates the impact of the network s structure ( triangle inequality ) to the social cost of efficient pure nash equilibria .        *
( strong equilibria )  @xcite * a strategy profile @xmath46 is a strong equilibrium if no subset of agents can deviate in coordination , so that each and every one of its members is better off .
it is an @xmath21-approximate strong equilibrium if no subset of agents can deviate in coordination , so that each and every one of its members is better off by a factor strictly more than @xmath75 .
we analyze evolution of an equilibrium through iterative best response , initialized at configuration @xmath76 .
in fact , for _ any _ strategy profile @xmath46 that is reached through iterative best response initialized at @xmath76 , we will upper bound the ratio @xmath77 .
thus we do not require that @xmath76 be the socially optimum configuration , nor that @xmath46 is an equilibrium strategy profile .
we only require that @xmath46 is reached by iterative best response initialized at @xmath76 . then taking @xmath76 to be the socially optimum configuration and @xmath46 to be the reached equilibrium will yield an upper bound for the price of stability , as a corollary . to facilitate clarity
, we give a brief description of the analysis plan . given any facility node @xmath78 denote by @xmath79 the subset of agents connected to @xmath10 in @xmath76 . then @xmath80 will be the total cost incurred by @xmath81 collectively .
we will upper bound @xmath77 as follows :    @xmath82    define @xmath83 to be the increase in cost caused by agent @xmath7 during iterative best response initialized at @xmath76 and reaching @xmath46 . for any subset @xmath84 of agents we also use @xmath85 . to evaluate the upper bounding expression  ( [ equation : plan ] ) , we are going to use an upper bound on @xmath86 , valid _ for any _ @xmath78 .
this is the increase in social cost caused during iterative best response by agents connected to @xmath10 in @xmath76 .
then for any @xmath78 we will maximize @xmath87 , by lower bounding @xmath80 for any @xmath78 . in determining an upper bound on @xmath88
we prove the following lemma , which charges any specific agent @xmath7 a bounded amount of social cost increase during the execution of iterative best response .
let @xmath81 be the subset of agents that are connected to @xmath10 in @xmath76 .
for any @xmath89 define @xmath90 to be the subset of agents that have not yet deviated from @xmath10 , exactly before the first deviation of @xmath7
. then @xmath91 .
[ lemma : ibr - charging ]    for simplicity let @xmath92 .
clearly @xmath93 .
let us analyze contribution of @xmath7 to social cost increase during its first deviation . by deviating
, @xmath7 reduces its individual cost from @xmath94 to @xmath95 , by joining another facility node @xmath96 . then
:    @xmath97    @xmath98 and @xmath99 is the connection cost payed by @xmath7 before and after its first deviation .
@xmath100 is the number of agents sharing facility cost at @xmath96 , including @xmath7 .
since @xmath101 , it is @xmath102 .
let @xmath103 be the difference caused to the social cost by this single deviation of @xmath7 .
we examine the following cases :    1 .
@xmath104 , @xmath105 : then @xmath106 .
@xmath107 , @xmath108 : then @xmath109 .
@xmath104 , @xmath110 : then @xmath111 .
@xmath107 , @xmath112 : then @xmath113 .    clearly the above hold in general during execution of iterative best response , for any agent that performs a single deviation from a node @xmath10 to a node @xmath96 .
now we implement a charging procedure along with iterative best response .
give all agents an initial label @xmath114 , before executing iterative best response .
the labels will be updated during iterative best response , so that increases caused by agent @xmath7 will be charged to an appropriate agent @xmath115 .
initialize @xmath116 for all @xmath117 .
we will make use of the auxiliary variables @xmath118 and @xmath100 , as they were described before . at any time @xmath119
is the number of agents ( including @xmath7 ) connected to @xmath10 , right after @xmath7 _ joined _ @xmath10 .
we need to initialize @xmath119 to a value for every @xmath78 and @xmath89 , to implement the charging scheme .
set @xmath120 to a distinct value from @xmath121 .
@xmath122 will be always ( during iterative best response ) the number of agents connected to @xmath10 exactly before deviation of @xmath7 from @xmath10 ( before @xmath7 _ leaves _
@xmath10 ) . charging is then implemented by relabeling deviating agents in the following manner .    1 .
if @xmath123 no relabeling is needed .
2 .   otherwise there must be some @xmath124 connected to @xmath10 such that @xmath125 . in this case exchange labels of @xmath7 and @xmath126 .
subsequently add the increase caused by deviation of @xmath7 to @xmath127 .
finally , set @xmath128 equal to the number of agents connected to @xmath96 right after @xmath7 has joined @xmath96 .    by the previous definitions it follows that if @xmath129 , then it is always @xmath130 , i.e. @xmath7 has joined @xmath10 before some agent @xmath126 with @xmath125 , but leaves @xmath10 `` out of order '' , i.e. before @xmath126 leaves . by exchanging labels of @xmath7,@xmath126
we add the increase caused by @xmath7 to the agent that previously labeled @xmath126 .
possible increases in 1.,2.,3.,4 .
, imply that any agent is charged by the end of iterative best response at most @xmath131 for some @xmath7 .
if we `` guess '' the exact order of first deviation of all agents , we can initialize @xmath132 .
then each @xmath7 itself will be charged at most @xmath131 .
@xmath133    in what follows we are going to upper bound the ratio @xmath134 for any @xmath78 . if no agent @xmath89 ever deviates from playing @xmath10 , then clearly it will be @xmath135 .
our analysis focuses on two remaining cases : either _ (
i ) _ there is a non - empty set of agents @xmath136 that never deviate from @xmath10 during iterative best response or _
( ii ) _ all agents @xmath89 deviate from @xmath10 during iterative best response . case _ ( i ) _ is examined in proposition  [ intermmediate - case ] , whereas the analysis is concluded by analysis of _ ( ii ) _ in theorem  [ theorem : metric - pos - ub ] .    let @xmath46 be a strategy profile reached by iterative best response initialized at strategy profile @xmath76 . for any facility @xmath78 define @xmath79 and let @xmath137 the subset of agents that never deviated from @xmath10 , during iterative best response . if @xmath138 , then @xmath139 . [ intermmediate - case ]    as discussed previously , we will upper bound the ratio @xmath87 , by deriving an upper bound for @xmath88 and a lower bound for @xmath80 . by lemma  [ lemma : ibr - charging ] follows immediately :    @xmath140 \label{equation : delta - ub}\ ] ]    because agents in @xmath141 never deviated , whereas the rest caused a cost increase equal to @xmath11 times a harmonic series term each . in what follows
we show a lower bound on @xmath80 .
fix any facility @xmath78 , and define @xmath142 . without loss of generality assume such an order of agents , that agents @xmath143 ( and for every @xmath78 ) `` best - respond '' consecutively ; e.g. assume that the algorithm scans the facilities in @xmath144 in an arbitrary fixed order and for each facility , the agents connected to it in an arbitrary fixed order .
we focus only on the first deviation of each agent @xmath143 for some @xmath78 .
let @xmath96 be the node that @xmath7 deviates to .
for convenience we use @xmath145 and let @xmath146 . let @xmath147 be the total number of agents connected to @xmath96 _ right after _ deviation of @xmath7 .
the new cost of @xmath7 right after its first deviation is : @xmath148 .
for any other agent @xmath149 that , either deviates from @xmath10 to some node @xmath150 after the deviation of @xmath7 , or never deviated from @xmath10 ( in this case consider a trivial deviation with @xmath151 ) , we have respectively :    @xmath152    substitute @xmath153 in  ( [ equation : deviation - preference ] ) by triangle inequality : @xmath154 .
let @xmath155 denote the number of agents connected to @xmath10 _
right before _ deviation of @xmath7 from @xmath10 . also note that @xmath156 , because @xmath7 decreases its individual cost by deviating .
thus we obtain :    @xmath157    because @xmath158 , and because the latter has to hold for every pair of distinct agents @xmath159 , we deduce :    @xmath160 \label{equation : connection - lb-1}\ ] ]    we use  ( [ equation : connection - lb-1 ] ) for the connection cost of agents in @xmath161 , and @xmath162 for agents in @xmath163 ; in essence for every @xmath164 we simply set in  ( [ equation : connection - lb-1 ] ) @xmath151 , @xmath165 , and take @xmath166 .
the cost @xmath80 is then :    lcl c_v(s^ * ) & & _ v + _ k=|a_s(v)|^|a_s^*(v)| ( - ) + & = & _ v+ ( -h(|a_s^*(v)|)+h(|a_s(v)| ) ) [ equation : v - cost - lb ]    using the bounds  ( [ equation : v - cost - lb ] ) and  ( [ equation : delta - ub ] ) we deduce the following upper bound :    lcl ( _ ia_s^*(v)c_i(s))/c_v(s^ * ) & & + & & [ equation : metric - pos - ub ]    the latter inequality follows by bounds for the harmonic number , i.e. @xmath167 , where @xmath168 is the _ euler _ constant . by setting @xmath169
, we can numerically maximize the upper bound with respect to @xmath170 , to at most @xmath18 , for @xmath171.@xmath133    if @xmath46 is a strategy profile for the unweighted metric facility location game , reached by iterative best response initialized at a strategy profile @xmath76 , then @xmath172 .
[ theorem : metric - pos - ub ]    we only need to complement the result of proposition  [ intermmediate - case ] by considering the case where @xmath173 .
that is , @xmath174 , and all agents connected to @xmath10 in @xmath76 deviate during iterative best response . if for each @xmath143 that deviates from @xmath10 to @xmath96
( @xmath96 is not necessarily the same for every @xmath7 ) it is @xmath175 , then :    @xmath176    thus , assume there is at least one agent @xmath126 with @xmath177 . in general ,
let @xmath178 be the _
integer , so that @xmath179 for all @xmath180 . using the same arguments that led to  ( [ equation : connection - lb-1 ] ) , and taking @xmath181
, we deduce :    @xmath182    using  ( [ equation : x - lb ] ) we end up with a similar lower bound to  ( [ equation : v - cost - lb ] ) for @xmath183 :    @xmath184    to finish the proof , we note that by  ( [ equation : x - lb ] ) , deviation of agents with @xmath185 , yields a total cost increase ( payed as new connection cost ) of at most @xmath186 , which is exactly equal to the cost saved by closing the facility at @xmath10 ( because all agents deviate ) .
thus we can simulate the situation with the case analyzed in proposition  [ intermmediate - case ] , by setting @xmath187 and @xmath188 , so as to end up with  ( [ equation : metric - pos - ub ] ) .
this is technically equivalent to assuming that agents @xmath7 with @xmath185 never deviated.@xmath133    the price of stability for the unweighted metric facility location game with fairly allocated facility costs is at most @xmath18 .
we analyze a worst - case example , that makes the pos for unweighted metric facility location at least @xmath19 asymptotically .
experimental evidence shows a lower bound @xmath189 , which we believe is tight for pos .
this is because the analysis of theorem  [ theorem : metric - pos - ub ] embodies some losses due to bounding of harmonic numbers by logarithms .
our construction appears in fig .
[ figure : metric - pos - lb](a ) .
take @xmath71 agents , @xmath0 of them residing on a singe node @xmath10 of the network .
facility opening costs are assumed @xmath190 everywhere .
the social optimum @xmath76 has @xmath191 facilities : @xmath10 and @xmath192 , @xmath193 , where @xmath194 .
let the @xmath0 agents residing on @xmath10 be serviced by @xmath10 in @xmath76 , whereas the rest are equally partitioned to facilities @xmath192 , @xmath193 ; every facility @xmath192 services a batch of @xmath194 agents . in the least expensive equilibrium @xmath46 , all agents from each facility @xmath195 of @xmath76 will deviate and miss - connect to @xmath10 .
we will analyze for _ any _ single facility @xmath192 - henceforth denoted by @xmath196 - the ratio @xmath197 .
analysis for the rest of the facilities will be similar , and will yield asymptotically the same result .
in particular , by choosing to analyze _ any _ batch of @xmath23 agents that deviate from @xmath196 to @xmath10 , the pos will be lower bounded as :    @xmath198    for some _ constant _ @xmath199 we will have @xmath200 of the agents in @xmath81 increase their connection cost significantly by deviating , hence the social cost . for every @xmath89 let @xmath201 be the distance of @xmath7 from @xmath196 , and @xmath202 the increase in connection cost after deviation .
we determine @xmath201 and @xmath202 by following best responses of agents in @xmath203 .
let @xmath204 be the number of agents already connected to @xmath10 before agents of @xmath203 deviate to @xmath10 in order . in particular :    * for @xmath205 set @xmath206 ; a small decrease @xmath207 causes @xmath7 to deviate to @xmath10 .
* for each of the remaining @xmath208 agents set @xmath209 .    by similar arguments as for the derivation of ( [ equation : deviation - preference]),([equation : connection - lb-0 ] ) and triangle inequality , we obtain @xmath210 , where @xmath211 .
this yields @xmath212 for @xmath213 ( the remaining @xmath208 agents ) .
note that the @xmath208 remaining agents will deviate to @xmath10 , because they prefer to pay strictly less than @xmath214 , instead of a cost share @xmath215 each , for the facility at @xmath196 . by deviation
they `` shut - down '' the facility at @xmath196 and decrease the social cost by @xmath190 , but pay a total connection cost @xmath216 for @xmath10 , which tends to @xmath190 for large @xmath0 .
let us now derive the cost @xmath217 .
for convenience we use the notation @xmath218 to denote @xmath219 . for the first @xmath178 agents , summing up as in  ( [ equation : v - cost - lb ] ) yields :    @xmath220- \frac{1}{2}\frac{r}{\lambda+r}+\frac{1}{2}\delta h(\lambda+r,\lambda ) \label{equation : v - opt}\ ] ]    the cost of agents in @xmath203 after deviation is : @xmath221 . by substituting @xmath222
, we obtain :    @xmath223- \frac{1}{2}\left ( \frac{r}{\lambda+r}+\delta h(\lambda+r,\lambda ) \right ) \label{equation : eq - cost}\ ] ]    we simplify  ( [ equation : v - opt ] ) and  ( [ equation : eq - cost ] ) and substitute to  ( [ equation : metric - pos - lb ] ) appropriately . for @xmath224
we use the following bounds :    @xmath225    where @xmath226 is the _ euler _ constant .
also we use @xmath227 , because @xmath228 .
then  ( [ equation : metric - pos - lb ] ) becomes :    @xmath229- \frac{1}{2}\frac{r}{\lambda+r}-\frac{1}{2}\delta h(\lambda+r,\lambda ) } { \frac{1}{\sqrt{n}}+ 1+\frac{1}{2 } \bigl[\frac{r}{k - r+1}-\delta h(k , k - r)\bigr]- \frac{1}{2}\frac{r}{\lambda+r}+\frac{1}{2}\delta h(\lambda+r,\lambda ) } \rightarrow \label{equation : pos - exp}\ ] ]    @xmath230- \frac{1}{2}\frac{r}{\lambda+r}-\frac{1}{2}\delta h(\lambda+r,\lambda ) } { \frac{1}{\sqrt{n}}+ 1+\frac{1}{2 } \bigl[\frac{1-p}{p}+1-\gamma-\ln\frac{1}{p-1/k}\bigr]- \frac{1}{2}\frac{r}{\lambda+r}+\frac{1}{2}\delta h(\lambda+r,\lambda ) } \ ] ]    notice that for large @xmath0 , @xmath231 , because @xmath232 , and @xmath204 .
furthermore it is @xmath233 , because @xmath234 , with @xmath204 and @xmath235 . assuming that @xmath236 is a constant , the limits of numerator and denominator exist , and
we can use them to calculate the limit of the fraction . given
@xmath168 the pos lower bound is simplified to :    @xmath237    numerical maximization over @xmath199 yields @xmath238 , for @xmath239 .
we also searched computationally for @xmath178 maximizing  ( [ equation : pos - exp ] ) , for increasing @xmath0 .
for @xmath240 we found the values appearing in the table  [ figure : metric - pos - lb](b ) , that indicate @xmath241 .
one can verify that any configuration other than @xmath76 and @xmath46 is more expensive , by definition of distances of agents from @xmath10 and @xmath192 .
strong equilibria do not generally exist in the facility location game , even for unweighted agents on metric networks with uniform facility costs .
we illustrate this by an example , over the network shown in fig .
[ figure : strong ] .
consider the _
metric _ case in figure  [ figure : strong ] .
there are three unweighted agents @xmath242 situated on distinct nodes @xmath8 of the depicted 6-node cycle . for any equilibrium strategy profile @xmath46 there exist two agents @xmath243 , with @xmath244 with @xmath245 , @xmath246 . by agreeing to open a facility on vertex @xmath247 , @xmath7 and
@xmath126 would change their costs to @xmath248 and @xmath249 respectively , each lowering their cost by at least @xmath250 .
hence , this example does not have strong equilibria .
existence of pure equilibria for weighted agents is also an open issue .
however , we were able to reduce to a constant the logarithmic approximation factor @xmath21 known for general network design  @xcite .
in fact , our result is even more general , as it concerns _ strong _ equilibria .
we make use of the following remark .
if an instance of the facility location game does not have strong equilibria , then there is at least one cycle of deviations of particular coalitions that results in a circular sequence of configurations @xmath251 with @xmath252 .
[ cyclic - remark ]    given such a sequence @xmath251 , we denote the coalition that deviates from @xmath253 to form @xmath254 by @xmath255 .
such a deviation causes a cost decrease of agents in @xmath256 and possibly a cost increase of agents in @xmath257 .
recall that @xmath40 is the set of all agents .
we define two quantities , the _ weighted improvement _
@xmath258 for agents in @xmath256 and the _ weighted damage _
@xmath259 caused by agents in @xmath255 respectively :    @xmath260    we derive an approximation factor that eliminates cycles .
[ lemma : damage ] let @xmath251 with @xmath252 be a cycle of configurations in a facility location game instance , caused by consecutive deviations of coalitions .
the game instance has an @xmath21-approximate strong equilibrium if for all such sequences @xmath261 , where @xmath262 .    if there is no @xmath21-approximate strong equilibrium we know that there is at least one cycle @xmath251 such that @xmath263 .    because @xmath252 we have that @xmath264 for every agent @xmath7 .
then :    @xmath265    it follows that @xmath266 .
hence the lemma follows by contradiction.@xmath133    we derive an approximation factor as an upper bound of @xmath267 for any cycle
.    for every @xmath268 there exist @xmath21-approximate strong equilibria in the facility location game with fairly allocated facility costs , even for weighted agents and general networks .
we prove that @xmath269 for every cycle @xmath251 of configurations and the result follows from lemma  [ lemma : damage ] .
let @xmath270 be the set of agents going to @xmath10 in @xmath253 , but not in @xmath254 , and @xmath271 be the set of agents going to @xmath10 in both @xmath253 and @xmath254 .
note that @xmath272 , therefore :    @xmath273    @xmath274    hence , we need only consider what happens at the worst case node . for an agent @xmath7 in @xmath271
we get that :    @xmath275    it follows that : @xmath276 @xmath133    approximate strong equilibria are also approximate pure nash equilibria , thus :    the facility location game with fairly allocated facility costs and weighted agents has @xmath21-approximate pure strategy nash equilibria for every @xmath268 .
we derive next an upper bound on the spoa of @xmath21-approximate strong equilibria , for the general facility location game .    [
theorem : spoa - ub ] for any constant @xmath268 , the price of anarchy of @xmath21-approximate strong equilibria for the facility location game with fairly allocated facility costs , is upper bounded tightly by @xmath20 for unweighted and by @xmath4 for weighted agents , where @xmath5 is the sum of weights .
let @xmath46 and @xmath76 be the most expensive strong equilibrium and the socially optimum configuration respectively . for any facility node @xmath78 let @xmath81 and @xmath161 be respectively the subsets of agents connected to @xmath10 in @xmath76 , and connected to @xmath10 in @xmath76 but not in @xmath46 .
we will upper bound the spoa by @xmath277 $ ] . because @xmath46 is an @xmath21-approximate strong equilibrium , _ for every _ subset of @xmath161 there is at least one agent @xmath7 , that is not willing to deviate to @xmath10 in coordination with the rest agents of the subset .
let @xmath278 and @xmath279 , where @xmath7 is not willing to deviate in coordination with @xmath280 . then :    @xmath281    @xmath282    @xmath283    @xmath284    the result will follow from  ( [ equation : weighted - harmonic ] ) , because @xmath285 , and agents in @xmath286 play @xmath10 in @xmath46 and @xmath76 .
we analyze the spoa ratio .
for @xmath287 it is @xmath288 , which yields @xmath289 .
for weighted agents set @xmath290 and use @xmath291 for @xmath292 on  ( [ equation : weighted - harmonic ] ) :    @xmath293 @xmath133    * unweighted lower bound * we refer to fig .
[ figure : apx - spoa - lb ] for a tight ( non - metric ) lower bounding example in case of unweighted agents .
facility opening costs are @xmath190 .
it is clear that all agents being connected to node @xmath294 is the most expensive @xmath21-approximate equilibrium , of social cost @xmath295 : no agent coalition has incentive to deviate to @xmath296 , which is practically the node that all agents reside on , and results in a social cost of virtually @xmath190 , for @xmath297 ( e.g. @xmath298 ) .
-approximate strong equilibria ( @xmath268 ) . ]
we prove the following for the spoa of the unweighted metric facility location game :    the price of anarchy of @xmath2-approximate strong equilibria in the unweighted metric facility location game with fairly allocated facility costs is upper bounded by a constant . [
theorem : metric - spoa - ub ]    the proof of theorem  [ theorem : metric - spoa - ub ] consists of several partial results that we will synthesize .
let @xmath46 denote any @xmath21-approximate strong equilibrium and @xmath76 the socially optimum cofiguration .
we will upper bound the @xmath299 again by @xmath300 . for any facility node @xmath78 , define @xmath301 to be the subset of those agents that are connected to @xmath10 both in @xmath76 and @xmath46 .
define @xmath302 to be the subset of agents that are connected to @xmath10 in @xmath76 but not in @xmath46 .
see fig .
[ figure : metric - spoa - setup ] for an illustration of the definitions .
to simplify notation we use @xmath303 , for @xmath89 . at first
we consider the following simple case :    . ]
let @xmath161 be a subset of misconnected agents under @xmath21-approximate strong equilibrium profile @xmath46 .
let @xmath304 denote agents connected to @xmath10 under @xmath46 , with @xmath305 . if under @xmath306 no agent of @xmath161 has incentive to deviate to @xmath10 in coordination with @xmath161 , then @xmath307 .    if under @xmath306 no agent @xmath143 has incentive to deviate in coordination with @xmath308 to @xmath10 , then for every @xmath143 it is @xmath309 , because @xmath46 is an @xmath21-approximate strong equilibrium . then :    lcl _
ia_s^*(v)c_i(s ) & = & _ ia_s(v)c_i(s)+_ii_s^*(v)c_i(s ) + & & _ v+_ia_s(v)x_i^*+ ( _ v+_ii_s^*(v)x_i^ * ) + & & ( 1+)(_v+_ia_s^*(v)x_i^ * )    the latter equals @xmath310.@xmath133    for the rest of the analysis we treat the complementary case of that described in the previous lemma .
assume there exists at least one agent @xmath143 willing to deviate to @xmath10 in coordination with the coalition @xmath161 under @xmath306 .
define a _ minimal disagreeing subset _ @xmath311 to be a
_ minimal subset of misconnected agents _ containing an agent @xmath7 that would actually deviate to @xmath10 with @xmath312 , under @xmath306
. then also define @xmath313 .
fix @xmath314 to be from now on the agent ( or one of them if there are many ) that would deviate to @xmath10 in coordination with @xmath312 .
we call @xmath7 the _ unstable _ agent of the minimal disagreeing subset @xmath312 . by definition ,
the following holds for an _ unstable _ agent @xmath7 of the minimal disagreeing subset :    @xmath315    the rest of the analysis consists of bounds for agents in @xmath316 and @xmath317 separately .
in particular , lemmas  [ lemma : rest - ub ] and  [ lemma : dev - ub ] describe upper bounds for these sets respectively .
let @xmath161 be a subset of misconnected agents under an @xmath21-approximate strong equilibrium profile @xmath46 .
let @xmath312 be a minimal disagreeing subset of @xmath161 and @xmath314 an unstable agent . then :    @xmath318    [ lemma : rest - ub ]    by minimality of @xmath312 , every agent @xmath319 is _ not willing _ to deviate to @xmath10 under @xmath306 with a coalition of size @xmath320 .
thus for every @xmath319 :    @xmath321    summing over @xmath312 yields :    @xmath322    which is upper bounded by at most as in  ( [ equation : rest - ub]).@xmath133    let @xmath161 be a subset of misconnected agents under an @xmath21-approximate strong equilibrium profile @xmath46 .
let @xmath312 be a minimal disagreeing subset of @xmath161 and @xmath313 . then :    @xmath323 \label{equation : dev - ub}\ ] ]    [ lemma : dev - ub ]    without loss of generality name agents @xmath324 by distinct indices @xmath325 and define a series of supersets of @xmath312 , as follows : @xmath326 . because @xmath46 is an @xmath21-approximate strong equilibrium , every set @xmath327 contains an agent that is not willing to deviate to @xmath10 in coordination with @xmath327 .
this agent is found either in @xmath328 or in @xmath329 .
we can assume without any loss of generality that for subset @xmath327 this agent is @xmath126 ; otherwise we only need to exchange @xmath126 with some agent from @xmath330 .
one easily verifies that , by definition of a minimal disagreeing subset , such an exchange will not affect any of our previous results up to now .
then we have :    @xmath331    we omit @xmath332 and sum the inequality over @xmath324 . the result follows.@xmath133
the following lemma will provide a lower bound for @xmath333 appearing in  ( [ equation : dev - ub ] ) .
note that lemma  [ lemma : rest - ub ] provides a concrete upper bound for the cost ( under strategy profile @xmath46 ) of agents in @xmath161 , as a function of their connection cost in the socially optimum configuration @xmath76 and the corresponding facility cost @xmath11 .
this is not the case with lemma  [ lemma : dev - ub ] for agents in @xmath317 ; the upper bound  ( [ equation : dev - ub ] ) involves socially optimum connection cost plus @xmath11 multiplied by additional terms of harmonic numbers .
thus we need to determine how low the socially optimum connection cost can be , in order to derive an upper bounding ratio for the @xmath299 .
let @xmath161 be a subset of misconnected agents under @xmath21-approximate strong equilibrium profile @xmath46 .
let @xmath312 be a minimal disagreeing subset of @xmath161 and @xmath313 . then
:    @xmath334    let @xmath7 be the fixed _
unstable _ agent of @xmath312 .
note that , under strategy profile @xmath46 , @xmath7 does not have an incentive to join facility node @xmath335 for any @xmath324 . thus if @xmath126 pays for @xmath335 a share of @xmath336 ( that is
, @xmath335 serves @xmath337 agents in total in @xmath46 ) :    @xmath338    @xmath339    the latter inequality derives by usage of  ( [ equation : j - ub ] ) for @xmath340 , and by safely omitting @xmath332 . using  ( [ equation : everyone - ub ] ) and the lower bound for @xmath48 given in  ( [ equation : i - lb ] )
, we can solve for @xmath341 . by the definition of @xmath327 in lemma  [ lemma : dev - ub ] , it is @xmath342 , @xmath343 .
then we obtain :    @xmath344    finally we sum up the latter bound over all @xmath126 . notice that @xmath341 becomes non - negative only when @xmath345 .
since @xmath346 is an integral value , it turns out that @xmath341 becomes non - negative for those values of @xmath126 for which it is @xmath347 .
then , by setting @xmath348 , and by summing up over all @xmath126 we obtain the specified lower bound.@xmath133    [ [ proof - of - theoremtheoremmetric - spoa - ub ] ] proof of theorem  [ theorem : metric - spoa - ub ] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +    now we put everything together .
lower bound _ on @xmath80 is :    @xmath349    accordingly , we obtain the following _ upper bound _ on @xmath350 by  ( [ equation : rest - ub ] ) :    lcl _
ia_s^*(v)c_i(s ) & & _ li_s^*^0(v)c_l(s)+ _ jj_s^*(v)c_j(s)+_ia_s(v)c_i(s ) + & & 2(_li_s^*^0(v)x_l^*+_v)+ _ jj_s^*(v)c_j(s)+_ia_s(v)c_i(s )    using the latter bounds for @xmath80 and @xmath350 , we deduce :    lcr spoa & & 1 + ( 2_v+ 2_li_s^*^0(v)x_l^*+ _
jj_s^*(v)c_j(s ) ) / ( _ v+_li_s^*^0(v)x_l^*+_jj_s^*(v)x_j^ * ) + & & 1 + 2 + & = & 1 + 2 + 2 [ equation : metric - spoa - ub ]    the latter inequality emerged firstly by substitution from  ( [ equation : dev - ub ] ) , and secondly by removal of @xmath351 from numerator and denominator .
we maximize  ( [ equation : metric - spoa - ub ] ) by taking the lower bound of the denominator , given in  ( [ equation : spoa - connection - lb ] ) and obtain :    @xmath352    because @xmath353 , and by using logarithmic bounds for the harmonic numbers :    @xmath354    by substituting @xmath355 for @xmath168 and @xmath356 we can maximize numerically the resulting upper bounding function of @xmath357 to at most a constant .
note that , when strong equilibria exist , it is @xmath358 .
substituting so in  ( [ equation : analytic - metric - spoa - ub ] ) yields an upper bounding expression similar to the one of pos  ( [ equation : metric - pos - ub ] ) , up to constant multiplicative and additive terms.@xmath133
further investigation of the weighted game is mostly challenging : it is not known whether this game possesses pure equilibria . designing a counter - example seems quite demanding , as the game specializes in some sense the single - sink weighted network design game studied in  @xcite . for this case
pure equilibria were shown not to exist generally .
extending our analysis of the pos and spoa to the weighted metric case appears to be also non - trivial .
finally , derivation of good lower bounds for the pos and the spoa of the ( non - metric ) weighted case is an interesting aspect of research : lower bounding techniques developed in  @xcite do not readily apply for facility location .
for usefull discussions we thank the participants of the _ open problems jam sessions _ of cagt : daniel andersson , gudmund skovbjerg frandsen , kristoffer arnsfelt hansen , peter bro miltersen , rocio santillan rodriguez , troels bjerre soerensen , nikolaos triandopoulos .
e.  anshelevich , a.  dasgupta , j.  m. kleinberg , e.  tardos , t.  wexler , and t.  roughgarden . the price of stability for network design with fair cost allocation . in _ proceedings of the ieee symposium on foundations of computer science ( focs )
_ , pages 295304 , 2004 .
c.  chekuri , j.  chuzhoy , l.  lewin - eytan , j.  naor , and a.  orda . non - cooperative multicast and facility location games . in _ proceedings of the acm conference on electronic commerce ( ec ) _ , pages 7281 , 2006 .
b.  chun , k.  chaudhuri , h.  wee , m.  barreno , c.  h. papadimitriou , and j.  kubiatowicz .
selfish caching in distributed systems : a game - theoretic analysis . in _ proceedings of the acm symposium on principles of distributed computing ( podc ) _ , 2004 .
a.  fiat , h.  kaplan , m.  levy , s.  olonetsky , and r.  shabo . on the price of stability for designing undirected networks with fair cost allocations . in _ proceedings of the international colloquium on automata languages and programming ( icalp ) _ ,
pages 608618 , 2006 .
t.  d.  hansen and o.  a.  telelis . on pure and ( approximate ) strong equilibria of facility location games . in _ proceedings of the international workshop on internet and network economics ( wine ) _ , pages 490497 , 2008 .
a.  vetta .
nash equilibria in competitive societies , with applications to facility location , traffic routing and auctions . in _ proceedings of the ieee symposium on foundations of computer science ( focs ) _ ,
pages 416 , 2002 .


typical eukaryotic protein - coding genes contain introns , which are removed prior to translation .
key constituents of the spliceosome , which is the rna - protein complex that performs the intron excision , can be traced back   to the last common ancestor of extant eukaryotes ( leca ) .
even deep - branching lineages   have introns .
it is thus almost certain that spliceosomal introns were present in leca .
moreover , when comparing distant eukaryotes , intron positions often agree  .
the similarity is likely due more to conservation of early introns than to parallel gains  .
it is thus compelling to use genome - scale comparisons to study intron evolution in different lineages , and even to estimate the exon - intron organization in extinct ancestors .
one of the first such studies , by , involved orthologous gene sets in eight eukaryotes .
the same data set was reanalyzed by different authors  , using novel methods developed for intron data .
subsequent inquiries attest to a renewed interest in understanding the specifics of intron evolution within different eukaryotic lineages .
this paper introduces novel computational techniques for the analysis of spliceosomal intron evolution , anticipating more large - scale studies to come .
section  [ sec : identification ] describes an alignment method for intron - annotated protein sequences , as well as a segmentation method for identifying conserved portions of a multiple alignment .
section  [ sec : likelihood ] describes a likelihood framework in which intron evolution can be analyzed in a theoretically sound manner .
section  [ sec : compress ] scrutinizes a compression technique that accelerates the evaluation of the likelihood function .
the compression involves an @xmath4-time preprocessing step for  @xmath5 sites and a phylogeny with  @xmath6 species .
we show that the subsequent evaluation takes sublinear , @xmath7 time almost surely in the yule - harding model of random phylogenies , even in the case of arbitrary , constant - size alphabets .
fast evaluation is particularly important when the likelihood is maximized in a numerical procedure that computes the likelihood function with many different parameter settings .
section  [ sec : applications ] describes two applications of our methods . in one application ,
intron - aware alignment was used to validate some unexpected features of intron evolution before leca . in a second application , we analyzed intron evolution in 18 eukaryotic species .
we found evidence of intron - rich early eukaryotes and a prevalence of intron loss over intron gain in recent times .
orthologous introns can be identified by using whole genome alignments in the case of closely related genomes  . for distant eukaryotes ,
however , intron orthology can only be established through protein alignments  .
the usual procedure is to project intron positions onto an alignment of multiple orthologous proteins .
if introns in different species are projected to the same alignment position , then the introns are assumed to be orthologous .
intron annotation can be included in protein alignments by defining intron match and mismatch scores .
the alignment score is then computed as the sum of scores for amino acid matches , gaps , and intron matches .
incorporating intron annotation should lead to better alignments at the amino acid level , and to a more reliable identification of orthologous introns .
figure  [ fig : iali ] shows an example of such improvement .
intron scoring can be based on log - likelihood ratios in a probabilistic model  .
the model is defined by the joint distribution  @xmath8 for the intron state in two sequences  @xmath9 and  @xmath10 , and the prior distributions  @xmath11 and  @xmath12 .
aligned sites have states  @xmath13 with probability @xmath14 if the two sites are unrelated , or with probability  @xmath15 in case of homology .
an @xmath13 alignment is scored with a value that is proportional to @xmath16 .
we used the data set of   to assess the strength of intron - match signals . since the data include no sites in which all species lack introns ,
but the model does allow for that , we added extra sites with no introns .
the original data comprise 7236 intron sites in 684 genes , across 8 species . using a method described earlier , we added 35000 unobserved intron sites . using estimates for  @xmath8 and  @xmath17
, we computed the appropriate scores .
the intron score is asymmetric and varies with evolutionary distance and intron conservation .
matches for absent introns have an insignificant score , but shared introns have a high score , such as 93 ( human - plasmodium ) , 106 ( human - arabidopsis ) , 152 ( human-_s .
pombe _ ) or 303 ( drosophila - anopheles ) on a 1/60-bit scale . shared
introns thus give a signal comparable to amino acid matches : in the 1/60-bit scaled version of the vtml240 matrix  , a tryptophan match scores  289 , and an arginine identity scores  113 .
consider the case of aligning two protein sequences , @xmath9 and  @xmath10 , which are annotated with the intron positions .
every residue has two associated intron sites ( after the first and second nucleotides of their codons ) , and there is an intron site between consecutive amino acid positions ( phase-0 introns ) .
intron sites may or may not be filled in by introns in either sequence .
we use the notation for @xmath18}$ ] for the phase-0 site preceding the codon for amino acid  @xmath19 , and @xmath20}$ ] , @xmath21}$ ] for phase-1 and -2 sites within the codon .
intron presence is encoded by  @xmath22 , and intron absence is encoded by  @xmath23 throughout the paper .
the intron annotation is specified by the variables @xmath24}\in\{{\texttt{1}},{\texttt{0}}\}$ ] .
( there can be no introns after the last amino acid . )
scores for aligned introns are specified by a  @xmath25 scoring matrix  @xmath26 .
phase-1 and phase-2 intron sites are automatically placed by their associated amino acids .
if  @xmath27 is the amino acid scoring matrix , then the alignment of @xmath28 $ ] and  @xmath29 $ ] entails a score of @xmath30}}}\\{{{t}[j]}}\end{smallmatrix}}\bigr]}+{{\lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{{t}[j]}}\end{smallmatrix}}\bigr]}$ ] with @xmath31}}}\\{{{t}[j]}}\end{smallmatrix}}\bigr ] } = { { \lambda}\bigl[{\begin{smallmatrix}{{{s}[i\colon1]}}\\{{{t}[j\colon1]}}\end{smallmatrix}}\bigr]}+{{\lambda}\bigl[{\begin{smallmatrix}{{{s}[i\colon2]}}\\{{{t}[j\colon2]}}\end{smallmatrix}}\bigr]}$ ] .
similarly , aligning @xmath28 $ ] with an indel implies a score of @xmath30}}}\\{{\texttt{-}}}\end{smallmatrix}}\bigr]}+{{\lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{\texttt{0}}}\end{smallmatrix}}\bigr]}={{m}\big[{\begin{smallmatrix}{{{{s}[i]}}}\\{{\texttt{-}}}\end{smallmatrix}}\bigr]}+{{\lambda}\bigl[{\begin{smallmatrix}{{{s}[i\colon1]}}\\{{\texttt{0}}}\end{smallmatrix}}\bigr]}+{{\lambda}\bigl[{\begin{smallmatrix}{{{s}[i\colon2]}}\\{{\texttt{0}}}\end{smallmatrix}}\bigr]}$ ] , in addition to possible gap opening and closing penalties .
standard alignment procedures need to be modified to deal with phase-0 introns , since the placement of phase-0 introns is not fixed with respect to gaps .
it is not possible to simply add a new character to the alphabet to represent phase-0 introns because they affect gaps differently from amino acids .
we added intron scoring into a multiple alignment framework , using a sum - of - pairs scoring policy with affine gap - scoring .
it is np - hard to find the alignment of two multiple alignments under these optimization criteria  .
even the alignment of a single sequence to a multiple alignment necessitates sophisticated techniques  .
our solution therefore uses a gap - counting heuristic : namely , a gap - open penalty is triggered for an indel aligned with an amino acid if the indel is preceded by an amino acid or a phase-0 intron .
gap opening thus corresponds to a pattern @xmath32 or @xmath33 . here
, @xmath34 are intron states for the phase-0 site , and @xmath35 denotes either state . in addition
, @xmath36 denotes an arbitrary amino acid , @xmath37 is the indel character , and @xmath38 is either of the latter two .
we implemented affine gap - scoring by separate gap - open and -close penalties , so that gaps at the alignment extremities can be penalized less severely .
gap closing is counted for the patterns @xmath39 and @xmath40 .
table  [ tbl : ali ] gives the recurrences for a dynamic programming algorithm that aligns an intron - annotated sequence  @xmath9 to a multiple alignment  @xmath41 of @xmath42 intron - annotated protein sequences . in order to simplify the presentation
, we represent the sequences in such a way that every odd position of  @xmath9 and  @xmath41 is a regular residue or alignment column , annotated with information on the presence of phase-1 and phase-2 introns , whereas every even position is a phase-0 intron site .
we use @xmath31}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr]}$ ] to denote the sum of intron - match scores for the intron sites associated with the positions  @xmath28 $ ] , @xmath43 $ ] .
we use also the shorthand @xmath44}$ ] to denote scoring for the alignment of an amino acid  @xmath45 with an amino acid profile  @xmath46 .
the algorithm uses three types of variables , @xmath47}$ ] , @xmath48}$ ] and @xmath49}$ ] , which correspond to partial prefix alignments ending with aligned residues , gaps in  @xmath9 , or gaps in  @xmath41 , respectively . in case of  @xmath48}$ ] , the last indel must be aligned with an amino acid column , and , thus @xmath50 must be odd ; for  @xmath49}$ ] , @xmath19 must be odd .
@xmath51 }      & = \begin{aligned}[t ]          & { { m}\big[{\begin{smallmatrix}{{{{s}[i]}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr]}+{{\lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr]}+{\gamma^{(-)}_{1}}(j )          + \max\bigl\ {                { \mathsf{a}[i-2,j-2 ] }   + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{1}}(j ) + { \gamma^{(>)}_{1}}(j),\\ *          &      { \mathsf{gs}[i-2,j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{1}}(j ) + { \gamma^{(>)}_{2}}(j-2 ) ,                { \mathsf{gs}[i-1,j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] }    + { \gamma^{(<)}_{1}}(j )   + { \gamma^{(>)}_{2}}(j-2),\\ *          &      { \mathsf{gp}[i-2,j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{2}}(j )   + { \gamma^{(>)}_{3}}(j ) ,               { \mathsf{gp}[i-2,j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(>)}_{2}}(j )              \bigr\}\end{aligned }          & \text{odd $ i$ , odd $ j$}\\ { \mathsf{gs}[i , j ] }       & = \begin{aligned}[t ]          & { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(-)}_{2}}(j )              + \max\bigl\ {                { \mathsf{a}[i , j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{1}}(j),\\ *              & { \mathsf{gs}[i , j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } , \\ *              & { \mathsf{gp}[i , j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j)+{\gamma^{(>)}_{3}}(j ) ,                { \mathsf{gp}[i , j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{2}}(j )               \bigr\ }              \end{aligned }      & \text{odd $ i$ , odd $ j$}\\ { \mathsf{gp}[i , j ] }       & = \begin{aligned}[t ]          & { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(-)}_{1}}(j )          + \max\bigl\ {                { \mathsf{a}[i-2,j ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j),\\ *              & { \mathsf{gs}[i-2,j]}+ { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{2}}(j ) ,                 { \mathsf{gs}[i-1,j]}+ { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{2}}(j),\\ *              & { \mathsf{gp}[i-2,j]}+ { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] }               \bigr\ }          \end{aligned }       & \text{odd $ i$ , odd $ j$ }        \\ { \mathsf{gs}[i , j ] }      & = \begin{aligned}[t ]          & { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(-)}_{2}}(j )          + \max\bigl\ {              { \mathsf{a}[i-1,j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{1}}(j ) , \\ *              & { \mathsf{gs}[i-1,j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{4}}(i , j ) + { \gamma^{(>)}_{4}}(i , j ) ,                 { \mathsf{gs}[i , j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } , \\ *              & { \mathsf{gp}[i-1,j-2 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{{{p}[j-1]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{3}}(j ) ,                 { \mathsf{gp}[i-1,j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{3}}(j ) + { \gamma^{(>)}_{2}}(j )              \bigr\ }          \end{aligned }           & \text{even $ i$ , odd $ j$ } \\ { \mathsf{gp}[i , j ] }      & = \begin{aligned}[t ]          & { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr ] } + { \gamma^{(-)}_{1}}(j )          + \max\bigl\ {               { \mathsf{a}[i-2,j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr ] }   + { \gamma^{(<)}_{5}}(j )   + { \gamma^{(>)}_{5}}(j),\\ *              & { \mathsf{gs}[i-2,j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{5}}(j ) + { \gamma^{(>)}_{2}}(j-1 ) ,                { \mathsf{gs}[i-1,j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{\texttt{0}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr ] }    + { \gamma^{(<)}_{5}}(j ) + { \gamma^{(>)}_{2}}(j-1),\\ *              & { \mathsf{gp}[i-2,j-1 ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{{{p}[j]}}}\end{smallmatrix}}\bigr ] } + { \gamma^{(<)}_{6}}(j ) + { \gamma^{(>)}_{6}}(j ) ,                { \mathsf{gp}[i-2,j ] } + { { \lambda}\bigl[{\begin{smallmatrix}{{{{s}[i-1]}}}\\{{\texttt{0}}^h}\end{smallmatrix}}\bigr]}\bigr\ }          \end{aligned } & \text{odd $ i$ , even $ j$}\end{aligned}\ ] ]
gaps are scored by using affine penalties , with gap - open , -extend , and -close scores , denoted by @xmath52 .
the gap - counting heuristic implies that gap scores in the equations of table  [ tbl : ali ] are defined by the number of certain patterns in up to three consecutive alignment columns .
for instance , @xmath53 equals the gap - open penalty multiplied by the number of such rows in  @xmath41 where column  @xmath50 contains an indel , and column  @xmath54 has a phase-0 intron .
the corresponding pattern is described as  @xmath55 .
table  [ tbl : gaps ] lists the patterns for the gap - counting heuristic .
@xmath56}}$ has intron , otherwise nothing } \\ * { \gamma^{(<)}_{5 } } & { \texttt{1}}\text { or } { \texttt{x}}{\texttt{0 } } & { \gamma^{(<)}_{6 } } & { \texttt{1}}\\ * { \gamma^{(>)}_{1 } } & { \texttt{-}}{\texttt{0}}{\texttt{x}}\text { or } { \texttt{-}}{\texttt{1}}{\texttt { * } } & { \gamma^{(>)}_{2 } } & { \texttt{x}}\\ * { \gamma^{(>)}_{3 } } & { \texttt{1}}{\texttt{*}}\text { or } { \texttt{0}}{\texttt{x } } &      { \gamma^{(>)}_{4 } } & { \texttt{x}}\text { if $ { { { s}[i]}}$ has intron , otherwise nothing } \\ * { \gamma^{(>)}_{5 } } & { \texttt{-}}{\texttt{1 } } & { \gamma^{(>)}_{6 } } & { \texttt{1}}\\ * { \gamma^{(-)}_{1 } } & { \texttt{- } } & { \gamma^{(-)}_{2 } } & { \texttt{x}}\end{array}\ ] ]    table  [ tbl : ali ] does not show the initialization of the variables , nor the final gap - counting : they employ a logic analogous to the recurrences . at the end of the algorithm , the best of  @xmath57}$ ] , @xmath58}$ ] , @xmath59}$ ] is selected , and the actual alignment is found by standard traceback techniques  .
we implemented the algorithm in java .
the program iteratively realigns one sequence at a time to the rest of the sequences in a multiple alignment . instead of sequence - dependent intron match - mismatch scores ,
the implementation uses only two parameters : one for intron conservation and another for intron loss / gain .      in order to reliably identify orthologs
, we need to be able to distinguish regions of the alignment that are highly conserved from those that are less well - conserved . in poorly conserved regions
, we can not confidently infer intron orthology .
proposed post - processing pairwise sequence alignments into alternating blocks that score above a threshold parameter  @xmath60 or below  @xmath61 .
we attained a similar goal by adapting algorithmic technniques from .
the procedure separates a multiple alignment into alternating high- and low - scoring regions . using a complexity penalty  @xmath60
, a segmentation with  @xmath62 high - scoring regions has a segmentation score of @xmath63 where  @xmath64 is the sum of scores for the aligned columns .
column scores are computed without gap - open and -close penalties .
the best segmentation of an alignment of length  @xmath5 can be found in  @xmath65 time after the column scores are computed .
the result of this computation is that the total of column scores in each selected high - scoring region will be greater than  @xmath60 .
there may be small sub - regions of negative scores , but the total score of such a sub - region can not be less than  @xmath61 .
conversely , unselected regions score below  @xmath61 and can not have sub - regions scoring above  @xmath60 .
we use a markov model for intron evolution , as in previous studies  . for the sake of generality
, we describe the markov model over an arbitrary alphabet  @xmath66 of fixed size @xmath67 .
the intron alphabet is @xmath68 .
phylogeny _ over a set of species  @xmath69 is defined by a rooted tree  @xmath70 and a probabilistic model .
the leaves are bijectively mapped to elements of  @xmath69 .
each tree node  @xmath71 has an associated random variable  @xmath72 , which is called its _ state _ or _ label _ , that takes values over  @xmath66 .
the tree  @xmath70 with its parameters defines the joint distribution for the random variables  @xmath72 .
the distribution is determined by the _ root probabilities _ @xmath73 and _ edge transition probabilities _
@xmath74 assigned to every edge  @xmath75 .
the root probabilities give the distributon of the root state .
edge transition probabilities define the conditional distributions @xmath76 . along every path away from the root , the node states form a markov chain .
the leaf states form the _ character _
an input data set ( or _ sample _ ) consists of independent and identically distributed ( iid ) characters : @xmath78 .    in case of intron evolution ,
introns are generated by a two - state continuous - time markov process with _ gain _ and _ loss rates _
@xmath79 along each edge  @xmath75 .
the edge length is denoted by  @xmath80 . using standard results  , the transition probabilities on edge  @xmath75 with rates @xmath81 and
length  @xmath82 can be written as @xmath83 , @xmath84 , and @xmath85 , @xmath86 . in the absence of established edge lengths
, we fix the edge length scaling in such a way that @xmath87 .
independent model parameters are thus @xmath88 , @xmath89 and  @xmath80 for all edges  @xmath75 .
it is important to allow for branch - dependent rates , since loss and gain rates vary considerably between lineages .    in a maximum likelihood approach ,
model parameters are set by maximizing the likelihood of the input sample .
let  @xmath90 be the input data .
every  @xmath91 is a vector of  @xmath6 states , and we write  @xmath92 to denote the observed state of leaf  @xmath71 . by independence ,
the likelihood of  @xmath93 is the product @xmath94 .
each character s likelihood can be computed in @xmath95 time , using a dynamic programming procedure introduced by .
the procedure relies on a `` pruning '' technique , which consists of computing the conditional likelihoods  @xmath96 for every node  @xmath71 and letter  @xmath97 .
@xmath96 is the probability of observing the leaf labelings in the subtree of  @xmath71 , given that  @xmath71 is labeled with  @xmath97 .
the likelihood for the character  @xmath45 equals @xmath98 .
intron data are somewhat unusual in that an all-@xmath23 character is never observed : the input does not include sites in which introns are absent in all of the organisms .
the uncorrected likelihood function is therefore misleading , as it underestimates the probability of intron loss . to resolve this difficulty
, we employ a correction technique proposed by for restriction sites .
( describes an alternative technique based on expectation maximization . )
we compute the likelihood under the condition that the input does not include all-@xmath23 characters .
we use therefore the corrected likelihood @xmath99 , and maximize @xmath100 .
our goal is to give a reliable characterization of the dynamics of intron evolution .
in particular , we aim to give estimates for intron density in ancestral species , and for intron loss and gain events on the edges .
notice that the estimation method needs to account for ancestral introns even if they got eliminated in all descendant lineages .
it is possible to do that with the help of conditional expectations , which fit naturally into a likelihood framework .    for an observed character  @xmath45 , we define _ upper conditional likelihoods _  @xmath101 so that @xmath102 .
upper conditional likelihoods are computed with dynamic programming , from the root towards the leaves , in  @xmath4 time  , even for non - binary trees .
similar computations are routinely used in dna and protein likelihood maximization programs  . here
we allow irreversible probabilistic models , which explains why  @xmath101 must be computed in a top - down fashion in  .    the posterior probability for the state at node  @xmath71 is @xmath103 the posterior probabilities for state changes on an edge  @xmath104 are @xmath105    now
, the number of ancestral introns is estimated as the conditional expectation @xmath106 .
the formula takes into consideration unobserved intron sites , by estimating their number @xmath107 as the mean of a negative binomial random variable .
the number of intron state changes is estimated as @xmath108 .
in particular , @xmath109 is the number of introns lost , and @xmath110 is the number of introns gained on the edge leading to  @xmath111 .    in order to compute  @xmath112 , we initialize @xmath113 . on every edge  @xmath104 ,
there are many heuristics that accelerate likelihood - based phylogenetic reconstruction  , which mostly concentrate on the exploration of the tree space .
we propose an improvement to the evaluation of the likelihood function , which normally takes linear time in the input size .
our evaluation method yields an  @xmath115 speedup for typical trees .
we use it to optimize the parameters of intron evolution on a known tree , but the method is generally applicable to phylogenetic likelihood problems where the likelihood is numerically optimized .
the key idea is that it is enough to carry out the pruning algorithm once for every different labeling within a subtree .
different labelings within each subtree can be computed in a preprocessing step .
subsequent evaluations of the likelihood function with different model parameters are faster , and depend on the number of different labelings in the data set .    here
we describe how the preprocessing step can be carried out in  @xmath4 time .
secondly , we analyze the computational complexity of subsequent evaluations , and show that an  @xmath115 speedup is achieved for almost all random trees in the yule - harding model .
the latter analysis produces some novel concentration results on the number of subtrees with a fixed size  @xmath62 .    to our knowledge , the closest idea to ours
was articulated by .
specifically , they proposed identifying characters in which leaves in a subtree have identical labels .
they reported that in benchmark experiments with nucleotide sequences , likelihood optimization was accelerated by 1215% through this technique .
the technique relies entirely on the fact that alignments of closely related sequences exhibit high levels of identity , and can not be extended to non - identical labelings .
the yule - harding distribution is encountered in random birth and death models of species and in coalescent models  , and is thus one of the most adequate random models for phylogenies . in one of the equivalent formulations ,
a random tree is grown by adding leaves one by one in a random order .
the leaves are first numbered by using a random uniform permutation of the integers  @xmath116 .
leaves are joined to the tree in an iterative procedure . in step 1 , the tree is just leaf  1 on its own . in step 2 ,
the tree is a `` cherry '' with leaves  @xmath117 and  @xmath118 . in each subsequent step
@xmath119 , a random leaf  @xmath120 is picked uniformly from the set @xmath121 .
the new leaf  @xmath19 is added to the tree as the sibling of  @xmath120 , forming a cherry : a new node is placed on the edge leading to  @xmath120 and  @xmath19 is connected to it . the resulting random tree in iteration  @xmath6 has the yule - harding distribution  .    0.98    c    algorithm compress    * for * every leaf @xmath71 * do *    initialize @xmath122{\leftarrow}0 $ ] // _ @xmath123 $ ] is the first occurrence of state @xmath50 _    * for * @xmath124 * do *    * if * @xmath125 = 0 $ ] * then * @xmath125{\leftarrow}i$ ]    set @xmath126 $ ]    * for * every non - leaf node @xmath71 in a post - order traversal *
do *    initialize the map @xmath127 as empty [ line : compression.map.init ]    let @xmath128 be the left and right children of @xmath71    * for * @xmath124 * do *    * if * @xmath129 * then * @xmath130 [ line : compression.map.set ]    set @xmath131 [ line : compression.map.get ]      the likelihood can be computed faster by first identifying the different  @xmath91 values , along with their multiplicity in the data . for large trees ,
the input typically consists of many different labelings , but for small trees with  @xmath132 , the compression is useful , since the number of different  @xmath91 values is bounded by  @xmath133 . in order to exploit the benefits of compression ,
we extend it to every subtree .
[ def : compression ] define the multiset of observed labelings for every node  @xmath71 as follows .
let  @xmath134 denote the number of leaves in the subtree rooted at  @xmath71 , and let  @xmath135 denote those leaves . define  @xmath136 for every labeling  @xmath137 of the leaves in the subtree of  @xmath71 as the number of times  @xmath138 is observed in the data : @xmath139 where  @xmath140 denotes the indicator function that takes the value 1 if its argument is true , otherwise it is  0 .
define also the set of observed labelings @xmath141    the multisets of observed labelings are computed in the preprocessing step .
the likelihood function is evaluated subsequently by computing the conditional likelihoods at each node  @xmath71 for the labelings of  @xmath142 only , in  @xmath143 time .    in order to compute  @xmath144
, we use a recursive procedure .
it is important to avoid working with the @xmath95-dimensional vectors  @xmath138 of definition  [ def : compression ] directly , otherwise the preprocessing may take superlinear time in  @xmath6 .
for that reason , every labeling @xmath145 is represented by the index  @xmath19 for which  @xmath91 is the first occurrence of  @xmath138 .
accordingly , we compute an auxiliary array  @xmath146 , which stores the first occurrence of each labeling  @xmath91 in  @xmath71 s subtree . in particular , @xmath147 if  @xmath148 is the smallest index such that @xmath149 for all  @xmath62 where  @xmath150 are the leaves in  @xmath71 s subtree .
figure  [ fig : compression ] shows that the values  @xmath146 can be computed in a post - order traversal .
after  @xmath146 are computed for all  @xmath19 and  @xmath71 , the multiplicities  @xmath144 and observed labelings  @xmath142 are straightforward to calculate in linear time .
the map  @xmath151 in lines  [ line : compression.map.init][line : compression.map.get ] is sparse with at most  @xmath5 entries , and can be implemented as a hash table so that accessing and updating it takes  @xmath152 time
. consequently , algorithm  compress takes @xmath4 time .
0.98    l    algorithm loglikelihood    * for * every leaf @xmath71 do    set @xmath153[a']{\leftarrow}\chi\{a = a'\}$ ] for all @xmath154 and @xmath155    * for * every non - leaf node @xmath71 in a post - order traversal * do *    * for * every labeling @xmath145 * do *    let @xmath156 be the children of @xmath71 , and let @xmath157 be their subtree labelings    * for * every @xmath158    @xmath159[a ] { \leftarrow}\prod_{j=1,2}\sum_{a'\in{\mathcal{a } } } p_{uu_j}(a\rightarrow a ' ) l_{u_j}[y_j][a']$ ]    set @xmath160    * for * every labeling @xmath161 * do *    @xmath162[a]\bigr)$ ]    * return * @xmath163      after the preprocessing step , the conditional likelihoods are computed only for the different labelings within each subtree .
figure  [ fig : likelihood ] shows the evaluation of the likelihood function .
the running time for the algorithm is @xmath164 where  @xmath165 is the total number of different labelings within all subtrees : @xmath166 if  @xmath167 denotes the number of leaves in the subtree rooted at  @xmath71 , then  @xmath142 has at most  @xmath168 elements .
hence ,  @xmath165 is bounded as @xmath169 observe that by sheer number of arithmetic operations , it is always worth evaluating the likelihood function this way .
the worst situation is that of a caterpillar tree ( where every inner node has a leaf child ) . in that case , there are only a few ( @xmath170 ) non - leaf nodes for which we can compress the data , and it is possible to construct an artificial data set in which there are  @xmath5 different labelings for @xmath171 subtrees .
caterpillar trees , however , are rare in phylogenetic analysis .
typical phylogenies have fairly balanced subtrees  .    in
what follows , we examine the bound of   more closely in the yule - harding model .
the analysis relies on a characterization of the random number of subtrees with a given size , as expressed in theorems  [ tm : sizes.mean ] and  [ tm : sizes.concentration ] .
[ tm : sizes.mean ] consider random evolutionary trees with  @xmath6 leaves in the yule - harding model .
let  @xmath172 denote the number of subtrees with  @xmath173 leaves in a random tree .
the expected value of  @xmath172 is @xmath174 trivially , @xmath175 .
derives equation   by appealing to a plya urn model .
an equivalent result is stated by .
@xmath176    [ tm : sizes.concentration ] for all @xmath177 ,    [ eq : sizes.tail ] @xmath178    consider the random construction of the tree .
let  @xmath120 denote the random leaf picked in step  @xmath19 to which leaf  @xmath19 gets connected , for @xmath179 .
each random variable  @xmath120 is uniformly distributed over the set  @xmath121 , and @xmath180 are independent .
moreover , they completely determine the tree  @xmath10 at the end of the procedure .
consequently , @xmath172  is a function of  @xmath181 : @xmath182 .
the key observation for the concentration result is that if we change the value of only one of the  @xmath120 in the series , then @xmath172 changes by at most two . in order to see this , consider what happens to the tree  @xmath10 , if we change the value of exactly one of the  @xmath120 from  @xmath138 to  @xmath183 .
such a change corresponds to a `` subtree prune and regraft '' transformation  .
specifically , the subtree  @xmath184 , defined as the child tree of the lowest common ancestor  @xmath71 of  @xmath138 and  @xmath19 containing the leaf  @xmath19 , is cut from  @xmath10 , and is reattached to one of the edges on the path from the root to  @xmath183 .
now , such a transformation does not affect  @xmath172 by much .
notice that subtree sizes are strictly monotone decreasing from the root on every path . on the path from the root to  @xmath71 ,
subtree sizes decrease by the size  @xmath185 of  @xmath184 , and  @xmath71 disappears , contributing a change of @xmath186 , @xmath187 or  @xmath188 to  @xmath172 .
( at most one subtree of size  @xmath189 that contains @xmath184 now has size  @xmath62 , and at most one subtree of original size  @xmath62 is not counted anymore : it may be @xmath71 s subtree itself , or a subtree above it . )
an analogous argument shows that regrafting contributes a change of  @xmath186 , @xmath187 , or  @xmath188 .
hence , the function  @xmath190 is such that by changing one of its arguments , its value changes by at most  @xmath118 . as a consequence , mcdiarmid s inequality  ( @xcite )
can be applied to bound the probabilities of large deviations for  @xmath172 . in particular , for all  @xmath177 , @xmath191 where  @xmath192 and @xmath193 since @xmath194 for all  @xmath19 , @xmath195 , implying eq .  .
an identical bound holds for the right - hand tail of the distribution .
@xmath176    remark .
the particular case of  @xmath196 was considered by  .
they showed that the distribution of  @xmath197 is asymptotically normal with mean  @xmath198 and variance  @xmath199 .
the result suggests that the best constant factor in the exponent of eqs .
is  @xmath200 for  @xmath201 , instead of  @xmath202
. gave exact formulas for the variance of  @xmath172 .
he showed that the variance of  @xmath172 is @xmath203 .
the variance formulas were given earlier in a different context by .
( see also the discussion by . )
the result suggests that by analogy with the cherries , the best constant factor in the exponent is  @xmath204 .
it is thus plausible that the probability is properly bounded by @xmath205 in theorem  [ tm : compute ] below .
[ tm : compute ] with probability  @xmath206 , the likelihood function can be evaluated for random trees in the yule - harding model in @xmath207 time after an initial preprocessing step that takes  @xmath4 time . evaluating the likelihood function takes  @xmath4 time in the worst case , and @xmath208 time on average .
we need the following lemma for the proof of theorem  [ tm : compute ] .
[ lm : sum.q^i / i ] for all @xmath209 , @xmath210 .
for all @xmath211 and @xmath212 , @xmath213 .
the proof is straightforward by induction in  @xmath214 .
notice that the right order of magnitude is @xmath215 but we need a bound for all  @xmath214 .
@xmath176    .effect of the compression on three data sets .
the fourth column quantifies the direct evaluation method , the fifth column quantifies the effect of the compression restricted to the root , the sixth column corresponds to the bound of eq .   and
the seventh column gives the exact value of  @xmath165 .
the first data set is from rogozin et al .
( 2003 ) , the second data set is the one analyzed here in   [ ss : app.ancestors ] , and the third one is an unpublished data set we have worked on , where an ambiguity character is included in the alphabet .
[ cols=">,>,^ , > , > , > , > " , ]      genbank flatfiles and protein sequences were downloaded from refseq and ensembl .
exon - intron annotation was extracted from the genbank flatfiles .
the _ c.  briggs _ protein sequences and genome annotation were downloaded from wormbase , and intron annotation was extracted from the gff annotation file .
table  [ tbl : data ] lists the data sources and the species abbreviations .
we used the 684 ortholog sets , each corresponding to a cluster of orthologous groups , or kog , from the study of as `` seeds '' for compiling a set of putative orthologs for our species .
for each seed ( consisting of homologous protein sequences for eight species ) , we performed a position - specific iterated blast search . in case of plasmodium species
, we used three iterations against a database of all protozoan peptide sequences in refseq .
we used an e - value cutoff of  @xmath216 for retaining candidates .
each candidate hit was then used as a query in a reversed position - specific blast ( rpsblast ) search against the kog database .
candidates were retained after this point if they had the highest scoring hit ( by rpsblast ) against the same kog as the kog of the seed data , and they scored within  80% of the best such hit for the species .         from the resulting set of paralogs , we selected a putative ortholog set in the following manner . for each kog , we selected all possible triples of human - arabidopsis - saccharomyces paralogs and kept the triple that had the highest score in alignments built by muscle  .
alignment score was computed using the vtml240 matrix  .
additional putative orthologs were added for one species at a time , by aligning each paralog individually to the current profile , and keeping the one that gave the largest alignment score . at this iterative addition , scoring was done with the vtml240 matrix , by summing the five highest pairwise scores between a candidate and already included sequences .    the resulting sets were then realigned using muscle , and then realigned again using our intron - aware alignment with a gap penalty of  300 , gap - extend penalty of  11 , vtml240 amino acid scoring , intron - match scores of  300 and intron - mismatch penalties of  20 .
( these latter were established using different intron - match and -mismatch scores , and selecting the ones that gave the fewest number of intron sites while decreasing the score of the implied protein alignment by less than  0.1% . )
conserved portions were extracted using our segmentation program with a complexity penalty of  @xmath217 ( larger values gave identical segmentation results , and lower values resulted in too many scattered blocks ) .
we penalized indels with an infinitely large value to exclude gap columns .
phase-0 introns falling on the boundaries of conserved blocks were excluded . intron presence and absence in the aligned data
was then extracted to produce the data for the likelihood programs .
figure  [ fig : posteriors ] shows the estimated intron densities for ancestral species .
it is notable that ancestral nodes such as the bilaterian ancestor ( node 4 ) , the ecdysozoan ancestor ( node 5 ) , the opisthokont ancestor ( node 15 ) , and the bikont ancestor ( node 16 ) all have very high intron densities , surpassing most previous estimates  .
the ecdysozoan ancestor has an even higher estimated intron density ( 80% of human density ) than the otherwise quite generous estimates ( about 70% ) of , which is mostly due to the inclusion of the relatively intron - rich honeybee genes .
intron density in the bilaterian ancestor is estimated to be almost as high as in humans ( 94% ) , agreeing with estimates of .
sequences of a handful of intron - rich genes from the marine annelid _
platynereis dumerilii _ have already indicated that the bilaterian ancestor s genome was at least two - thirds as intron - rich as the vertebrate genomes even by conservative estimates  .
introns are for the most part lost on the branches .
figure  [ fig : changes ] shows the estimated changes in a few lineages .
intron evolution has been much slower in the vertebrate lineage than in most other lineages : in more than 380 million years since the divergence with fishes , only about 3% of our introns got lost .
fungi , for example , massively trimmed their introns in many lineages .
a notable exception is _ c.  neoformans _ , which seems to have gained introns , but that assessment may change if another basidiomycete genome becomes available besides the relatively intron - poor _
u.  maydis_.
we presented a novel alignment technique for establishing intron orthology , and a likelihood framework in which intron evolutionary events can be quantified .
we described a compression method for the evaluation of the likelihood function , which has been extremely valuable in practice .
we also showed that the compression leads to sublinear running times for likelihood evaluation .
we illustrated our methods for analyzing intron evolution with a large and diverse set of eukaryotic organisms .
the data set is more comprehensive than any used in other studies published to this day .
the data indicate that ancestral eukaryotic genomes were more intron - rich than previous studies suggested .
many circumstances influence intron loss , and realistic likelihood models need to introduce rate variation .
usual rate variation models   entail multiple evaluations of the likelihood function , and , thus , underline the importance of computational efficiency .
we believe that the proposed methods will help to produce and analyze large data sets even within complicated likelihood models .
this research is supported by a grant from the natural sciences and engineering research council of canada .
adachi , j. and m.  hasegawa ( 1995 ) .
version 2.3 : programs for molecular phylogenetics based on maximum likelihood .
volume  28 of _ computer science monographs _ , pp .
tokyo , japan : institute of statistical mathematics .
altschul , s.  f. , t.  l. madden , a.  a. schffer , j.  zhang , z.  zhang , w.  miller , and d.  j. lipman ( 1997 ) .
gapped blast and psi - blast : a new generation of protein database search programs .  _
25_(17 ) , 33893402 .                                              ma , b. , z.  wang , and k.  zhang ( 2003 ) .
alignment between two multiple alignments . in r.
a. baeza - yates , e.  chvez , and m.  crochemore ( eds . ) , _ proc .
combinatorial pattern matching ( cpm ) _ , volume 2676 of _ lncs _ , pp .
springer .
raible , f. , k.  tessmar - raible , k.  osoegawa , p.  wincker , c.  jubin , g.  balavoine , d.  ferrier , v.  benes , p.  de  jong , j.  weissenbach , p.  bork , and d.  arendt ( 2005 ) .
vertebrate - type intron - rich genes in the marine annelid platynereis dumerilii .  _ 310 _ , 13251326 .
rogozin , i.  b. , y.  i. wolf , a.  v. sorokin , b.  g. mirkin , and e.  v. koonin ( 2003 ) .
remarkable interkingdom conservation of intron positions and massive , lineage - specific intron loss and gain in eukaryotic evolution .
_ 13 _ , 15121517 .
stamatakis , a.  p. , t.  ludwig , h.  meier , and m.  j. wolf ( 2002 ) . : a fast program for sequential and parallel phylogenetic tree calculations based on the maximum likelihood method . in _ proc .
ieee computer society bioinformatics conference ( csb ) _ , pp .