Research Article

The Connected -Median Problem on Cactus Graphs

Algorithm 1

An algorithm for the connected p-median problem of cactus graphs.
Input: A cactus graph , the corresponding rooted skeleton , and the maximum level
Output: A connected median and the sum of weighted distance to
(1)Set
(2)fordo
(3)for vertex with do
(4)  if represents a graft then
(5)   Find the companion hinge of in , assuming it to , and calculate the level
(6)   Call GRAFT to calculate the values and find for of level and all possible integers , and set .
(7)  end
(8)  if represent a cycle then
(9)   Find the companion hinge of in , assuming it to
(10)   Call CYCLE to calculate the values and find for of and all possible integers , and set .
(11)  end
(12)  if represents a hinge then
(13)   Call HINGE to calculate the values and find for all possible integers , and set .
(14)  end
(15)end
(16)end
(17)fordo
(18) Call HINGE to calculate the values and for each hinge of
(19)end
(20)return use formula (33) to calculate and find a connected -median .