  Fog computing is seen as a promising approach to perform distributed,
low-latency computation for supporting Internet of Things applications.
However, due to the unpredictable arrival of available neighboring fog nodes,
the dynamic formation of a fog network can be challenging. In essence, a given
fog node must smartly select the set of neighboring fog nodes that can provide
low-latency computations. In this paper, this problem of fog network formation
and task distribution is studied considering a hybrid cloud-fog architecture.
The goal of the proposed framework is to minimize the maximum computational
latency by enabling a given fog node to form a suitable fog network, under
uncertainty on the arrival process of neighboring fog nodes. To solve this
problem, a novel approach based on the online secretary framework is proposed.
To find the desired set of neighboring fog nodes, an online algorithm is
developed to enable a task initiating fog node to decide on which other nodes
can be used as part of its fog network, to offload computational tasks, without
knowing any prior information on the future arrivals of those other nodes.
Simulation results show that the proposed online algorithm can successfully
select an optimal set of neighboring fog nodes while achieving a latency that
is as small as the one resulting from an ideal, offline scheme that has
complete knowledge of the system. The results also show how, using the proposed
approach, the computational tasks can be properly distributed between the fog
network and a remote cloud server.
