so since the model that we created in
or was a fact a network-based model I'm
not gonna spend a whole long time
talking about links and all that kind of
stuff instead I want to talk about kind
of what kinds of network environments
you can easily see within net logo and
what kinds of environments exist out
there and by the way there's an entire
example of models in the net logo models
library called networks right and so I
highly encourage you if you're
interested in this topic to take a look
at that right and so there are a bunch
of different types of networks that
exists out there right you can have grid
environments which are essentially our
regular networks right so if you think
about it right those kind of square
lattices are a regular network if you
will where each of the connections are
exactly the same right you could then
have a scale-free network right so this
is a network it's often called a
preferential attachment network where
the connections between individuals are
dependent upon how many connections they
already have you can have a random
network sometimes referred to as an
erdos-renyi random network right which
is a network in which the connections
the probability of a link existing
between any two individuals is
controlled by some pre-specified
probability right and so it's a very
random set of connections you can have a
small world network which is nice
because it's kind of between a grid
network or a regular network and a
random network and has been shown to
have some very interesting properties
and in fact many real-world networks
have been shown to have properties of
small world networks and then you can
also pull in real world data and use
that to represent your network structure
within the model right so you know just
to visualize what these networks look
like at times this is from the the watts
and Strogatz 1997 paper this is a
regular network right and it might not
look like a lattice or something like
that but in fact it is right because
each node in that has exactly two
neighbors in it right and so it can be
on either side right so they have four
neighbors overall and so in some ways
this is reflective of are very similar
to some of the square lattices we saw
before right but it's slightly different
because it's in a ring it's a ring lat
right and so in this case we have a
regular Network and on the other side we
have a random network right and what
lots of show guys did that was
interesting was they showed that if you
start with a regular network and you
randomly rewire some of the nodes well
if you randomly everywhere zero you have
a regular if you ran anywhere all of
them have ran Network and in between you
get this kind of what they call small
world network where most people are
connected to their friends on either
side of them but some people have these
long connections and this actually the
small world network gets you a lot of
the properties that we see in real world
social networks for instance the famous
six degrees of separation property that
you see is derive because of this small
world network a couple of people that
you know are nearby but then you know
one friend in India or Germany or
something like that and they are able to
provide a long disconnection this is the
net logo preferential attachment model
right so this is another topology space
you can have and what bear box and
Albert's kind of insight was was that
the Watson Strogatz model is great at
representing the topology of connections
but it doesn't take into account the
fact that some people just have more
friends than other people right and so
what they did was they said well what is
the probability of you being attached to
a certain individual was equal was
roughly proportional to the number of
friends they are a had and what that
does is that generates again some
interesting properties so you see in
real world networks right for instance
one of the things that naturally comes
out of this is what's called the friends
paradox and the friends paradox is the
fact that on average your friends have
more friends than you do right and that
seems kind of confusing but it's because
this is a heavy tailed distribution
there are a few individuals who have a
lot a lot of friends and so because that
on average you're not one of those
people which means that on average one
of your friends is one of those people
and as a result when you average all of
their friends when they have a lot of
friends with you and your friends who
have a very
we have a smaller number of friends than
they do you're going to get more friends
on average right
and so this is an interesting result of
something like the preferential
attachment property which seems to exist
some people are just very friendly and
so they have lots of friends and of
course it that little you can also pull
in real world data so this was an actual
net logo model that we built back a
while ago now where we pulled in Twitter
data and we actually looked at the
relationship between individuals in
Twitter right and what's interesting is
that this network see has some of the
properties of the small world network
and some of the properties of the
preferential attachment network but it's
not perfectly represented by either of
them so that's kind of an interesting
idea there so I'm going to stop here I'm
going to show you a couple of the models
let me show you the small world model
and the preferential attachment model
there are built into that logo so here
we have the net logo small world model
and in this particular case by the way
the model is actually create not using
the net logo extension just oh sorry the
network extension but there are some
cool primitives to create small world's
models using the network's extension but
this one actually takes you through how
to actually build the model it kind of
shows you what the network distension
does right so we're going to set it up
and when we hit the setup button or
venture originally all it does is create
that ring lattice that we were looking
at right where each node is connected to
a number of nodes on either side in this
case if I remember correctly it is two
nodes on either side let's double check
that real quick so we see there's the
wire them procedure which is what's
connecting the nodes in fact yes it
makes an edge to two turtles on either
side of it and it uses this command edge
and if you look at make edge by the way
make edge just creates a link with that
one
so now we can hit rewire one and what
this does is it breaks one of those
edges and rewires the edge
you know and we can keep doing this
right and essentially we are creating a
a small world network and in fact what
we can do and this is a cool place where
a behavior space works well right so we
can bring in behavior space and we can
run it and actually I'm not even gonna
run it with the output I'm just gonna
run it using the actual what's going on
here and what you see right so what I
had to do was I had a very the rewiring
probability from 0 to 1 and what the
original model really emphasized was
that when you do that there is this
space right around between 0.001 and
point 1 roughly in this space right here
where the question coefficient is still
relatively high but the average path
length remains high as well whereas as
you go further on right the the
clustering coefficient decreases
substantially so again I'm looking at
the preferential attachment model now
and in this case again we're not using
the networks essential we're just gonna
build this up using the primitives of
networks and links and that logo and
what you do see is when I hit set up I
create two notes and I create a
connection between them and then as I
let this run what it does is it adds
nodes in such a way it's the probability
of an attaching to an existing node is
is is proportional to the number of
edges that node RA has so let me reset
that up again right and so now we have
two nodes and we add one it has equal
probability of joining either one
because each one had one edge so join
that node now the next one joins and it
actually had a higher probability of
joining this node because that node not
had two edges but actually chose this
right this is a random decision right
and it was basically it was at at that
point because they two of them have two
edges and each of them have one it was a
50% 25% 25% probability right so we can
let it go again and now it had a higher
probability thing the two middle nose
because they had two edges in fact
that's what it joined it joined if I
spread it out a little bit they joined
that one
middle ones right and now we can do it
again and again and again and again and
again and again and what this creates is
what's sometimes referred to as a
hub-and-spoke structure right where the
central nodes have a high probability of
being connected to because they already
have a high number of nodes and the
outer nodes have a lower probability and
what what barabasi and Albert showed is
that this network structure is very
reflective actually have many of the
engineered systems we've seen but also
social systems out there as well before
we leave the context of networks I
didn't want to mention one other thing
so we're used to thinking about networks
in terms or at least to think about
environments in terms of kind of
standard things like distances and stuff
like that but in networks a lot of those
numbers no longer make sense right the
Euclidean distance between two agents
doesn't make sense in a network based
environment instead what we want to
think about is network measures and
there are different types of measures
for networks they're often very
interesting to use so degree
distribution is already been mentioned
right that's the idea that if we look at
how likely it is to find an individual
with a particular degree that gives us
some indication of the network structure
and there are two other ones there are a
little more complex that are often
popularly discussed and so I wanted to
mention them now one of them is the
average clustering coefficient so
clustering coefficient is how many uh
Navarrete how many friends of my friends
are my friends right or another way to
think about is out of all the possible
triangles that it could exist between me
and my friends how many of those
actually exist so the triangle means you
know two people and they know each other
right so that's a triangle
and what this tells you is that if that
number is very high right the network is
very tightly clustered if the number is
very low then network is not very
tightly clustered or if you look at the
individual level then that individuals
friends don't know each other right
finally another measure that's often
used this average path length an average
path length tells you how closely
related any one individual is on
every other individual in fact the app
when we talk about six degrees of
friendship or six degrees of connection
we are essentially talking about the
average path length of that network
right we're talking about how close
those individuals are to each other
how many friendship connections is that
from any person the network to any other
person to put this in context in most
real-world networks they often have
surprisingly low average path lines for
a high clustering coefficient often when
you have a high clustering coefficient
the average path length school up
because you have these tight clusters
and it's hard to get between them but
somehow real-world social networks
managed to avoid this the other thing is
that with regards to degree
distributions they tend to be power loss
scaled in other words there are a few
individuals who have a lot of friends
and a lot of individuals who have very
few friends right and so these are
interesting things to take into account
when you're building your agent base
model if you're going to build it in a
social network space I should mention
here briefly that there's no reason why
networks in net logo have to be a social
networks they could be networks of
supply chains they could be networks
used to represent connections between
things maybe based upon a feature space
kind of a network representation right
and but so networks are very powerful
and that's why actually in the upcoming
work on this textbook we're actually
going to be adding in even more network
content so that's it for networks
tomorrow we're going to start by a
couple of more environments and then
we're gonna get into the third and final
component of agent based models
interactions