  Vehicular fog computing (VFC) is envisioned as an extension of cloud and
mobile edge computing to utilize the rich sensing and processing resources
available in vehicles. We focus on slow-moving cars that spend a significant
time in urban traffic congestion as a potential pool of on-board sensors, video
cameras, and processing capacity. For leveraging the dynamic network and
processing resources, we utilize a stochastic mobility model to select nodes
with similar mobility patterns. We then design two distributed applications
that are scaled in real-time and placed as multiple instances on selected
vehicular fog nodes. We handle the unstable vehicular environment by a), Using
real vehicle density data to build a realistic mobility model that helps in
selecting nodes for service deployment b), Using community-detection algorithms
for selecting a robust vehicular cluster using the predicted mobility behavior
of vehicles. The stability of the chosen cluster is validated using a graph
centrality measure, and c), Graph-based placement heuristics are developed to
find the optimal placement of service graphs based on a multi-objective
constrained optimization problem with the objective of efficient resource
utilization. The heuristic solves an important problem of processing data
generated from distributed devices by balancing the trade-off between
increasing the number of service instances to have enough redundancy of
processing instances to increase resilience in the service in case of node or
link failure, versus reducing their number to minimise resource usage. We
compare our heuristic to an integer linear program solution and a first-fit
heuristic. Our approach performs better than these comparable schemes in terms
of resource utilization and/or has a lesser service latency, which is a crucial
requirement for safety-related applications.
