Will AI Put Content Creators Out of Work?

The intersection of artificial intelligence (AI) and the arts has given rise to a number of interesting and innovative developments in recent years. From AI-generated music and art to AI-written…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Epidemic spreading of information and ideas. Simulation on a Square Grid

Epidemiological approach of the spreading problem

To promote information about an idea, a product or a service, governments, institutions and firms often need a strategy for spreading it out efficiently over a network; that have to be designed and constructed according to their specific needs, goals and means. Because of the similarity between the processes of information and epidemic diseases spreading, most studies on information diffusion (marketing, advertising, scientific publications, political projects, …), are inspired by epidemic models.

One of the epidemic models often used is The Spread of Infection on a Square Grid. In his book “The Art of Mathematics, (2006)”, Béla Bollobás has posed and analyzed the problem of the epidemic spreading on a NxN square grid (with N=12).

On a NxN 2D grid (with N=12, see Figure-1), some (black) squares, say n=20, are infected and (N²-n) squares are healthy(white). At each contamination step, a new contaminated generation is appearing, and a healthy square will become infected only if it has more than one infected orthogonal neighbors (gray squares). There is no immunized square against infection, and infected squares remain infected forever.

Figure-1. Random distribution of n=20 infected (black) squares in NxN grid (N=12). Contaminated (grey) squares are the ones with more than one infected neighbors.

The original Bollobás problem asks, what is the minimum number x, of initially infected squares, that can spread an infection over the whole grid? With the help of a numerical simulation, we discuss in this post the minimum number x and how the x squares have to be distributed on the grid in order to assure the whole grid infection.

1- The random distribution

The first solution we propose, is the random distribution shown in (Figure-1). From an algorithmic point of view, this is the cheapest solution, since we don’t need additional computations to seek which squares are influential and which ones are not. However, if the initial number of infected squares is random, and there is no guarantee of infection over the whole grid.

2- The diagonal distribution

The diagonal distribution represents the Bollobás solution. If we put x=N=12 squares distributed along the main diagonal (Figure-2), then all the adjacent squares to the main diagonal distributed along two superdiagonals¹, have more than one infected neighbors and become all contaminated. They are the first contaminated generation. In terms of perimeter/ infected area size ratio, this distribution has probably the highest one. Once infected, they contaminate their healthy neighbors, and so on until the last square, after

N-1 steps of contamination. The diagonal infection is the fastest way to infect the whole grid.

3- The two-sides distribution

The two-sides distribution represented in (Figure-3) is another distribution, with x=N =12 squares. This distribution spreads the infection over the whole grid after 2(N-1)-1 steps of contamination. While its infected area perimeter equals the perimeter of the diagonal infection (22 squares), its power of contagion is weaker since it can contaminate only 12 squares (first contaminated generation), in comparison to the first generation 22 squares of the diagonal distribution.

Figure-3. Two-sides distribution of n=N infected (black) squares in NxN grid (N=12).

A brief comparison between these three distributions shows that the diagonal distribution is the most efficient choice in terms of “infection speed” since it requires only N-1 steps, of contamination for the whole grid infection.

Discussion

It appears from the Bollobás problem that epidemic spreading is a “critical phenomenon” since it can happen only if a critical concentration of infected squares is reached. In the case of the diagonal infection, if the initial number x of infected squares is less than N, then the total spreading would be unreachable.

It also appears that the perimeter of the infected area never increases as the infection grows. Simulation (see simulation section) of the Bollobás problem shows that the perimeter of the infected domain decreases as the infection grows until the whole grid infection is reached. The “infection speed” on the grid depends on the initial number of infected squares, but also on their geometrical position in the grid.

Python simulation of spreading

Let’s start by showing some algorithm elements on which our jupyter-python code is rested. We start (step-1) by importing the necessary libraries and widgets (tools for interactivity)

By using python “networkx” library, we create (step-2) a graph g, associated with a 2D square grid (side N=20). We define nng as a list of the nodes grid and ninf the number of infected nodes. We also define infected, a function that defines the distribution of infected squares: random or diagonal. By default our code displays the two-sides distribution of infected squares. For a random or diagonal distribution, just uncomment the associated block.

At the end of our program (Step-4), we set up the widgets functions: to show new contaminated generations of squares and to reset the current operation.

Figure-3

After checking the repository files (Figure-4), BinderHub redirects users toward the Jupyter server (Figure-5) where our program will run.

Figure-5
Figure-6

[1] superdiagonal entry is a diagonal that is directly above and to the right of the main diagonal

Add a comment

Related posts:

How to make the most of your experience reading Roger Scruton

Roger Scruton was a British philosopher, author, and public intellectual who was known for his benefactions to aesthetics, political philosophy, and conservative study. He was born in 1944 in…

The Tokay Gecko Versus the Vietnam Veteran

When I was in my late teens, I went off to dog grooming school, graduated, and got a job as a groomer in the back of Pet Palace. The year was 1988 and I was eager to start building my business and…

On Leadership

The floods in Texas and Makurdi this week resurrected a debate inside me. For a long time, I have heard people complain that Nigerians are the problem with Nigeria; that deep down we are corrupt and…