A Relation-Based Page Rank Algorithm for Semantic Web Search Engines Fabrizio Lamberti, Member, IEEE, Andrea Sanna, and Claudio Demartini, Member, IEEE APPENDIX The computational cost of the proposed ranking algo- rithm depends on the number of constrained spanning forests () , Qp l σ which are obtained by progressively re- moving edges from the spanning forests computed over the page sub-graph for a given query. For this, a closed formula for computing () , Qp l σ over a complete page sub- graph can be expressed as. () () () , 3 l Qp l l l λ λ σ κ χ = = (1) In the following, we will provide an example of appli- cation to a page sub-graph composed by six edges. The application to page sub-graphs composed by a generic number of edges is straightforward. Let us consider an annotated Web page p and a query Q . Let us define the corresponding page sub-graph , , , ( , ) Qp Qp Qp G C R where , 6 V Qp N C = = . If , Qp G is a com- plete graph, it is also ( ) , 1 /2 15 E Qp V V N R N N = = = . We start computing the number of (unconstrained) page spanning forest and we then extend the methodology to constrained spanning forests. The number of spanning forests (length 1 5 V N = ) could be easily computed using Cayley’s formula [1] as () 2 , 5 V N Qp V N σ = . Nevertheless, we propose an alternative way for calculating this value that can be subsequently used to compute the number of all the constrained spanning forests of decreasing lengths. The number of constrained spanning forests com- posed by five edges can be computed as the overall num- ber of possible combinations (without repetitions) of E N edges () 5 κ minus the number () 5 5 χ of sub-graphs com- posed by 5 edges and including a 5-cycle, minus the number () 4 5 χ of sub-graphs composed by 5 edges and including a 4-cycle and a free edge (thus possibly includ- ing a shorter cycle) minus the number ( ) 3 5 χ of sub- graphs composed by 5 edges and including a 3-cycle and two free edges (not resulting in any of the configurations above, thus, in other words, no 4-cycles). The overall number of possible combinations of 5 edges for the given number of edges of the graph can be expressed as ( ) (5) ,5 3003 E bin N κ = = . To calculate the number of sub- graphs composed by 5 edges and including a 5-cycle it is necessary to compute the number of combinations of five vertices over the six vertices of the graph and, for each, to take into account their possible alternative configurations. The number of configurations, given a specific cycle length like 5 in this case, is given by ( ) 5 1 !/ 2 12 = . Thus, the number of sub-graphs composed by 5 edges and including a 5-cycle is () ( ) 5 5 12 ,5 72 V bin N χ = = . We then compute () 4 5 χ , that is the number of sub- graphs composed by 5 edges and including a 4-cycle and a free edge (thus possibly including a shorter cycle). In this case, the number of all the possible combinations of four vertices over the six vertices of the graph has to be computed and, for each, their alternative configurations have to be considered. In this case, each combination shows three alternative configurations. For each combina- tion, and for each configuration of a particular combina- tion, the presence of an additional edge making the actual Fig. 1. Generation of 3-cycles due to the addition of a fifth “floating” edge to a configuration characterized by four edges. length of the sub-graph equal to five has to be taken into account. Thus, the total number of configurations for each combination has to be multiplied by the possible combi- nations of length one of the remaining edges ( 15 E N = minus the four edges already in use). In conclusion, the number of sub-graphs composed by 5 edges and includ- ing a 4-cycle in given by ( ) ( ) 3 ,4 4,1 495 V E bin N bin N = . It is worth observing that the addition of the fifth edge to the configurations above can result in the creation of 4- cycles possibly including shorter cycles (see for example Fig. 1 where the additional edge is drawn using a dot- ted line and resulting 3-cycles are shown as shaded tri- angles). In order not to take into account the contribution of these 3-cycles more than one time, it is necessary to subtract their number from the number of 4-cycles, thus getting the number of 4-cycles not including 3-cycles. This value can be computed as ( ) 32 ,4 90 V bin N = (where 2 is the number of alternative configurations of the additional edge generating 3-cycles). Thus, the number of 4-cycles (not including 3-cycles) is () 4 5 495 90 405 χ = = . To compute the number () 3 5 χ of sub-graphs com- posed by 5 edges and including a 3-cycle and two free edges (not resulting in any of the configurations above), the number of combinations of three vertices over the six vertices of the graph has to be calculated first. Then, for each combination, the addition of two edges chosen among the remaining 15 3 edges of the graph has to be considered, thus getting ( ) ( ) ,3 15 3, 2 V bin N bin configu- rations. However, this could result in configurations that has already been taken into account when dealing with 4- cycles. Moreover, this situation also brings to configura- tions where more than one 3-cycle is generated. In Fig. 2 it is presented an example where first a combination is gen- erated (lower triangle). Then, two other edges are added, thus generating the upper triangle (together with