Research Article

A Probabilistic Protocol for Multihop Routing in VANETs

Algorithm 1

Algorithm SteadyTraffic
Inputs:
  𝑇 : time limit,
𝐻 : maximum number of hops,
𝑀 : map with π‘š positions,
𝑅 : transmission range,
  𝑃 ( 𝑒 1 , 𝑒 2 ) : carry probability for every ( 𝑒 1 , 𝑒 2 ) , that is, probability
that a car appears at space time 𝑒 1 and moves to 𝑒 2 ,
𝑠 , 𝑑 ∈ 𝑀 : source and destination on the map 𝑀 .
Output:
 Communication probability 𝜌 ( 𝑠 , 𝑑 , 𝑇 ) from 𝑠 to 𝑑 with time limit 𝑇 .
begin
  ( 1 ) . / βˆ— The final value of A n s w e r ( π‘₯ , 𝑑 , π‘˜ ) will be the probability that there
  exists a communication path from ( 𝑠 , 0 ) to ( π‘₯ , 𝑑 ) with at most π‘˜ carries. βˆ— /
  ( 2 ) . For every space time 𝑒 = ( π‘₯ , 𝑑 ) do A n s w e r ( π‘₯ , 𝑑 , 0 ) = 0 ;
  ( 3 ) . A n s w e r ( 𝑠 , 0 , 0 ) = 1 ;
  ( 4 ) . for π‘˜ = 1 to 𝐻 do
  4-1. for every space time 𝑒 = ( π‘₯ , 𝑑 ) do
   4-1-1. A n s w e r ( π‘₯ , 𝑑 , π‘˜ ) = 𝑃 ( ( 𝑠 , 0 ) , 𝑒 ) ;
   4-1-2. for every other space time 𝑒 1 = ( π‘₯ 1 , 𝑑 1 ) such that 𝑑 1 ≀ 𝑑 do
     4-1-2-1. / βˆ— Let 𝐷 ( π‘₯ ) for π‘₯ ∈ 𝑀 be the set of 𝑅 -neighbors of π‘₯   βˆ— /
     4-1-2-2. 𝑝 1 ∏ = 1 βˆ’ π‘₯ 2 ∈ 𝐷 ( π‘₯ 1 ) ( 1 βˆ’ A n s w e r ( π‘₯ 2 , 𝑑 1 , π‘˜ βˆ’ 1 ) ) ;
     4-1-2-3. 𝑝 2 = 𝑃 ( 𝑒 1 , 𝑒 ) β‹… 𝑝 1 ;
     4-1-2-4. A n s w e r ( π‘₯ , 𝑑 , π‘˜ ) = A n s w e r ( π‘₯ , 𝑑 , π‘˜ ) ( 1 βˆ’ 𝑝 2 ) + 𝑝 2 ;
   4-1-3. end for
  4-2. end for
  ( 5 ) . end for
  ( 6 ) . return ∏ 1 βˆ’ π‘₯ ∈ 𝐷 ( 𝑑 ) 𝑑 ≀ 𝑇 ( 1 βˆ’ A n s w e r ( π‘₯ , 𝑑 , 𝐻 ) ) ;
end