Network Science samenvatting mid term
Samenvatting boek
Ch 0 introduction
network → an interconnected or interrelated chain, group, or system
- nodes → interconnected entities
- links → their connections
- reciprocal
- direction
social network → a group of people connected by some type of relationship
Summary
Networks are a general way to model and study complex systems with many interacting
elements. We have seen several examples of networks. Nodes can represent many different
types of objects, from people to Web pages, from proteins to species, from Internet routers
to airports. Nodes can have features associated with them beside labels: geographic
location, wealth, activity, number of connections, and so on. Links can also represent many
different kinds of relationships, from physical to virtual, from chemical to socal, from
communicative to informative. They can have a direction or be reciprocal. They can all be
the same or have different features such as similarity, distance, traffic, volume, weight, and
so on.
Ch1 Network Elements
node → a point in a network or diagram at which lines or pathways intersect or branch (set
of elements)
links → set of connections between pairs of nodes
- two nodes are adjacent or connected if there is a link between them
- neighbors → connected nodes
A network has two parts → nodes and links/edges
- the link (i, j) joins the nodes i and j.
- network can be directed(digraph) → links are called directed links and the order of
the nodes in a link reflects the direction or undirected → links are called bi-directional
and the order of the two nodes does not matter
- network can be unweighted or weighted. Weighted → links have associated weights.
node → vertex
link → edge
predecessor → link to
successors → link from
,total number of nodes → N → size of the network
total number of links → L
undirected → links do not have a direction and are represented as line segments
directed → represented as arrows
plaatje pag. 16
bipartite network → there are two groups of nodes such that links only connect nodes from
different groups and not nodes from the same group
multiplex network → network has multiple types of links
networkx
G = nx.Graph()
D = nx.DiGraph()
G.add_node(x)
G.add_edge(x,y)
G.add_nodes_from([x,y,z, …])
G.add_edges_from([(x,y), (y,z), (x,z), …])
G.nodes()
G.edges()
G.neighbors(x)
for n in G.nodes:
print(n, G.neighbors(n))
for u,v in G.edges:
print(u, v)
G.number_of_nodes()
G.number_of_edges()
G.predecessors()
G.successors
(x en y zijn aantal nodes)
B = nx.complete_bipartite_graph(x, y)
C = nx.cycle_graph(x)
P = nx.path_graph(x)
S = nx.star_graph(x)
maximum number of links in a network is bounded by the possible number of distinct
connections among the nodes of the system.
- given by the number of pairs of nodes
- complete network → network with the maximum number of links
- undirected network → 𝐿𝑚𝑎𝑥 = ( )
𝑁
2
= 𝑁(𝑁 − 1)/2
- directed network → 𝐿𝑚𝑎𝑥 = 𝑁(𝑁 − 1)
, - bipartite network → 𝐿𝑚𝑎𝑥 = 𝑁1 × 𝑁2
density → the fraction of possible links that actually exist, which is the same as the fraction
of pairs of nodes that are actually connected
- complete network has density 1
- often much smaller than 1 → sparsity
- 𝑑 = 𝐿/𝐿𝑚𝑎𝑥
2𝐿
- undirected network → 𝑑 = 𝐿/𝐿𝑚𝑎𝑥 = 𝑁(𝑁−1)
𝐿
- directed network → 𝑑 = 𝐿/𝐿𝑚𝑎𝑥 = 𝑁(𝑁−1)
networkx
nx.density(G)
CG = nx.complete_graph(x)
print(nx.density(CG))
subset of a network → subnetwork or subgraph → is obtained by selecting a subset of the
nodes and all of the links among these nodes
- clique → a complete subnetwork → a subset of nodes all linked to each other (any
subnetwork of a complete network is a clique because all pairs of nodes in the
network are connected and therefore all pairs of nodes in any subnetwork are also
connected)
- ego network → the subnetwork consisting of the chosen node(ego) and its
neighbors
networkx
K5 = nx.complete_graph(x)
clique = nx.subgraph(K5, (0, 1, 2))
degree of a node → is its number of links, or neighbors.
- 𝑘𝑖 → the degree of node 𝑖
- singleton → a node with no neighbors
Σ𝑖 𝑘𝑖
- the average degree of a network → < 𝑘 > = 𝑁
- andere formules zie pagina 24
networkx
G.degree(x) → degree of node x
G.degree() → degree of all nodes in G
degree of a node in a directed network → you have to think of incoming and outgoing links
separately.
𝑖𝑛
- predecessors → number of incoming links → in-degree → 𝑘𝑖
𝑜𝑢𝑡
- successors → number of outgoing links → out-degree → 𝑘𝑖
networkx