class: center, middle, inverse, title-slide .title[ # Networks in Archaeology ] .author[ ### ] .date[ ### 2024/02/29 ] --- ## Preamble 1. What is a 'network' -- 2. What are they useful for -- 3. How can they be applied in Archaeology -- - Example -- - Limits -- .pull-left[ </br> </br> </br> </br> - https://cdal.arch.cam.ac.uk/A11-networks/ - https://cdal.arch.cam.ac.uk/A11-networks/presentation.html </br> </br> <center> <img src="images/CDAL_Logo_fg_black_bg_none_694x744.png" alt="CDAL" width="80"> </center> ] -- .pull-right[ <!-- --> ] --- class: inverse, center, middle # What is a network? --- ### What is a network? .pull-left[ > Networks are nothing more than a set of entities and the pairwise connections among them. ] -- .pull-right[ <img src="images/archnetsci_bookcover.png" alt="CDAL" width="200px"> From Brughmans & Peeples 2023 ] -- .pull-left[ Ressources: - https://archnetworks.net/ ] --- ### What is a network? .pull-left[ Sociology, since August Comte: - Understanding human society through interactions between actors of the society {{content}} ] -- - From early sociologists at the end of XIXth early XXth following Comte: Durkheim, Lebon, Simmel, combined with biometrician to sociometrician (Moreno) -- .pull-right[ <img src="images/linkBank.png" alt="CDAL" width="200px"> <br> <small style='font-size:5pt'>(From Hobson 1894, in Freeman 2003)</small> {{content}} ] -- <img src="images/netfoot.png" alt="CDAL" width="150"> <br> <small style='font-size:5pt'>(From Moreno 1934, in Freeman 2003)</small> -- .pull-left[ - In the 90s, more data, more network {{content}} ] -- - A "science of Networks" -- .pull-right[ <img src="images/networkAnIntro.webp" alt="CDAL" width="150px"> <small style='font-size:6'>(Newman 2010)</small> ] --- ### Formal Networks Simple but very handy formalisation: -- - Nodes (vertices/agents/actors/sites/...) : A, B, C -- - Links (edges/connection): presence/absence (0-1, True, False) or weighted (distance,score,etc...). -- - Edge list -- .pull-left[ ```r A,C,1 # link between A & C B,C,5 # strong link between B&C ``` ] .pull-right[ </br> ] -- - Adjacency list -- - Adjacency matrix.... -- .small-left[ ```r A B C A 0 0 1 B 0 0 5 C 0 0 0 ``` ] --- class: inverse, ## Formal Network are easy to handle </br> </br> -- </br> </br> ## ... </br> </br> -- </br> </br> ## Even with R! --- ### Network with R A few examples -- </br> </br> (quick note) </br> **The igraph package:** Throughout this session we will use the package igraph to do our analysis ```r library(igraph) ``` There are plenty of other well known packages and program to do so such as: -- - [python-igraph](https://python.igraph.org/): igraph in python (and other) - [networkx](https://networkx.github.io/): another python package - [Gephi](https://gephi.org/) a powerful and intuitive graphical interface --- ### Network with R A few examples .pull-left[ ```r A,C,1 # link between A & C B,C,5 # strong link between B&C ``` Taking back the previous example ```r library(igraph) adjlist<-read.table(text=" v1 v2 weight A C 1 # link between A & C B C 5 # strong link between B&C ",header=T,comment="#") graph <- graph.data.frame(adjlist) par(mar=c(0,0,0,0)) plot(graph) mat=as_adjacency_matrix(graph,attr="weight") ``` {{content}} ] -- </br> </br> ``` ## 3 x 3 sparse Matrix of class "dgCMatrix" ## A B C ## A . . 1 ## B . . 5 ## C . . . ``` -- .pull-right[  ] --- ### Network with R A few examples .pull-left[ ```r library(igraph) adjlist<-read.table(text=" v1 v2 weight A B 1 A C 2 C A 2 B C 8 D E 10 D A 1 D C 1 ",header=T,comment="#") graph <- graph.data.frame(adjlist) plot(graph) mat=as_adjacency_matrix(graph,attr="weight") ``` {{content}} ] -- </br> </br> ``` ## 5 x 5 sparse Matrix of class "dgCMatrix" ## A C B D E ## A . 2 1 . . ## C 2 . . . . ## B . 8 . . . ## D 1 1 . . 10 ## E . . . . . ``` -- .pull-right[  ] --- ### Network with R A few examples <img src="images/linkBank.png" alt="CDAL" width="200px"> -- .pull-left[ ```r adjlist<-read.table(text=" ,DB,P,RM,G,CC BA,1,0,1,0,1 JL,1,0,0,0,1 MR,0,0,0,1,1 MSLL,1,0,0,0,1 NS,0,1,1,0,0 W,1,0,1,0,0 ",header=T,sep=",") aa=as.matrix(adjlist[,2:6]) rownames(aa)=adjlist[,1] graph=graph_from_incidence_matrix(aa) plot(graph,vertex.color=ifelse(V(graph)$type,1,2)) ``` ] -- .pull-right[  ] --- ### Network with R ```r par(mfrow=c(1,2),mar=c(0,0,0,0)) plot(bipartite_projection(graph)$proj2,vertex.color=1) plot(bipartite_projection(graph)$proj1,vertex.color=2) ``` --  --- ### Examples Everywhere Where there are _things_ and _links_, there are networks. -- .small-left[ Genetics </br> <a href="images/genetics.png"> <img src="images/genetics.png" alt="genet" width="300px"> </a> <small style='font-size:5pt'>(Atiia et al. 2020)</small> ] -- .small-left[ Biochemistry </br> <a href="images/biochemistry.png"> <img src="images/biochemistry.png" alt="biochem" width="300px"> </a> <small style='font-size:5pt'>(Ochieng et al. 2023)</small> ] -- .small-left[ Epidemiology </br> <a href="images/epidemio-net.png" > <img src="images/epidemio-net.png" alt="epinet" width="300px"> </a> <small style='font-size:5pt'>(Silk et al. 2022)</small> ] -- .small-left[ Ecology </br> <a href="images/eco-net.png"> <img src="images/eco-net.png" alt="ecology" width="70"> </a> <small style='font-size:5pt'>(Losapio et al. 2019)</small> ] -- .small-left[ Economy </br> <a href="images/politics.png" > <img src="images/politics.png" alt="geopol" width="300px"> </a> <small style='font-size:5pt'>(Fagiolo & Luzzati 2023)</small> ] -- .small-left[ Sociology </br> <a href="images/socialnet.png" > <img src="images/socialnet.png" alt="geopol" width="350px"> </a> <small style='font-size:5pt'>(Gaumont et al. 2018)</small> ] -- .small-left[ History </br> <video width="400" controls autoplay> <source src="images/1240064s2.mov" type="video/mp4"> </video> <small style='font-size:5pt'>(Schich et al. 2014)</small> ] --- class: inverse,center,middle # Explore & Compare networks and their properties --- ### A whole family of network types & Metrics .pull-left[ - Trees {{content}} ] -- - Random {{content}} -- - Small world {{content}} -- - Scale Free {{content}} -- - ... -- .pull-right[ - In and out degree {{content}} ] -- - Shortest Paths {{content}} -- - 'Length' {{content}} -- - Clustering {{content}} -- - Centrality {{content}} -- - ... --- ### Full graph A full graph is a graph where all nodes are connected .pull-left[ ```r fg <-make_full_graph(50) lfg=layout_nicely(fg) plot(fg,vertex.size=3,vertex.label=NA,edge.width=.1,layout=lfg) ``` ] -- .pull-right[  ] --- ### Random Graph Lot of way to do a 'random' graph, here adding node and randomly adding a edge .pull-left[ ```r rgg <- sample_growing(80, citation=FALSE,directed=FALSE) rgg=simplify(delete.vertices(rgg,which(degree(rgg)==0))) rggln=layout_nicely(rgg) plot(rgg,vertex.size=3,vertex.label=NA,edge.width=1,layout=rggln) ``` ] -- .pull-right[  ] --- ### Tree A tree is a directed graph with no loops. When no root is chose they are usually represented like this: .pull-left[ ```r tr <-make_tree(50,children=3,mode="undirected") plot(tr) ``` A graph made by 40 nodes, each node having maximum 3 children ] -- .pull-right[  ] --- ### Tree A tree is a directed graph with no loops. But more often, a root is chosen, which will be use at the `top` of the `tree` (the `root` of a rotated `tree`. .pull-left[ ```r plot(tr,layout=layout_as_tree(tr,root=1)) ``` ] .pull-right[  ] --- ### Small-world Watts-Strogatz model creates a lattice (with `dim` dimensions and `size` nodes across dimension) and rewires edges randomly with probability `p`. .pull-left[ ```r swA <- sample_smallworld(dim=2, size=7, nei=1, p=0.02) plot(swA, vertex.size=degree(swA), vertex.label=NA, layout=layout_in_circle) ``` A 49 nodes graph connected as a "small world". ] .pull-right[  ] --- ### Small-world .pull-left[ ```r sw <- sample_smallworld(dim=2, size=7, nei=1, p=0.1) swlc=layout_in_circle(sw) plot(sw, vertex.size=degree(sw), vertex.label=NA, layout=swlc) ``` A 49 nodes graph connected as a "small world". ] .pull-right[  ] --- ### Scale-free graphs Using Barabasi-Albert preferential attachment model (`n` is number of nodes, `power` is the power of attachment (`1` is linear); `m` is the number of edges added on each time step) .pull-left[ ```r ba <- sample_pa(n=50, power=1.01, m=1, directed=F) baln=layout_nicely(ba) plot(ba, vertex.size=degree(ba), vertex.label=NA,layout=baln) ``` ] .pull-right[  ] --- ### Multiple metrics to describe them - In and out degree - Shortest Paths - 'Length' --- ### In and Out Degree .pull-left[ ```r node ``` ``` ## [1] 6 ``` ```r degree(sw)[node] ``` ``` ## [1] 5 ``` ```r plot(sw, layout=layout_in_circle) ``` ] -- .pull-right[  ] --- ### In and Out Degree .pull-left[ ```r dgr=degree(sw) dgr=rbind("id"=seq_along(dgr),"degree"=dgr) print(dgr) ``` ``` ## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] ## id 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ## degree 3 3 4 5 5 5 3 2 3 3 3 6 4 4 4 4 4 4 3 ## [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] ## id 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ## degree 4 4 4 5 5 5 4 3 4 3 4 4 5 5 4 3 3 3 ## [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] ## id 38 39 40 41 42 43 44 45 46 47 48 49 ## degree 4 6 5 4 4 4 4 3 3 5 4 6 ``` ```r mean(degree(sw)) ``` ``` ## [1] 4 ``` ```r hist(degree(sw)) ``` ] -- .pull-right[  ] --- ### Comparing Degree distribution: <img src="presentation_files/figure-html/degreeComp-1.png" width="30%" /><img src="presentation_files/figure-html/degreeComp-2.png" width="30%" /><img src="presentation_files/figure-html/degreeComp-3.png" width="30%" /> <img src="presentation_files/figure-html/unnamed-chunk-15-1.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-15-2.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-15-3.png" width="30%" /> --- ### Shortest Path #### Small-world Between 5 and 34 .pull-left[ ```r sp534=shortest_paths(sw,5,34) print(sp534$vpath[[1]]) ``` ``` ## + 4/49 vertices, from 8abde4e: ## [1] 5 4 41 34 ``` ```r E(sw,path=sp534$vpath[[1]])$color="blue" E(sw,path=sp534$vpath[[1]])$width=2 plot(sw, vertex.size=6, layout=layout_in_circle) ``` ] .pull-right[  ] --- ### Shortest Path #### Small-world Between 1 and 12 .pull-left[ ```r sp112=shortest_paths(sw,1,12) print(sp112$vpath[[1]]) ``` ``` ## + 4/49 vertices, from 8abde4e: ## [1] 1 2 44 12 ``` ```r E(sw,path=sp112$vpath[[1]])$color="red" E(sw,path=sp112$vpath[[1]])$width=2 plot(sw, vertex.size=6, layout=layout_in_circle) ``` ] -- .pull-right[  ] --- ### Shortest Path #### Full graph Between node 3 and 45 .pull-left[ ```r sp345=shortest_paths(fg,3,45) print(sp345$vpath[[1]]) ``` ``` ## + 2/50 vertices, from 9ef0377: ## [1] 3 45 ``` ```r E(fg,path=sp345$vpath[[1]])$color="blue" E(fg,path=sp345$vpath[[1]])$width=4 plot(fg, vertex.label=NA, layout=lfg) ``` ] -- .pull-right[  ] --- ### Shortest Path #### Small-world What if we compute all shortest path? <video width="80%" controls loop><source src="presentation_files/figure-html/shortpathSWvideo.webm" /></video> --- ### Shortest path #### Scale-free graphs Between 4 and 48 .pull-left[ ```r E(ba)$color="grey" E(ba)$width=1 sp448=shortest_paths(ba,4,48) print(sp448$vpath[[1]]) ``` ``` ## + 4/50 vertices, from f42cac5: ## [1] 4 1 3 48 ``` ```r E(ba,path=sp448$vpath[[1]])$color="red" E(ba,path=sp448$vpath[[1]])$width=2 plot(ba, vertex.size=degree(ba), vertex.label=NA, layout=baln) ``` ] -- .pull-right[  ] --- ### Shortest path #### Scale-free graphs Between 10 and 34 .pull-left[ ```r sp1034=shortest_paths(ba,10,34) print(sp1034$vpath[[1]]) ``` ``` ## + 5/50 vertices, from f42cac5: ## [1] 10 7 1 4 34 ``` ```r E(ba,path=sp1034$vpath[[1]])$color="blue" E(ba,path=sp1034$vpath[[1]])$witdh=2 plot(ba, vertex.size=degree(ba), vertex.label=NA, layout=baln) ``` ```r E(ba)$color="grey" E(ba)$width=1 ``` ] .pull-right[  ] --- ### Shortest path #### Scale-free graphs <video width="80%" controls loop><source src="presentation_files/figure-html/shortpathBavideo.webm" /></video> --- ### Comparing Shortest Paths <img src="presentation_files/figure-html/shortpathComp-1.png" width="30%" /><img src="presentation_files/figure-html/shortpathComp-2.png" width="30%" /><img src="presentation_files/figure-html/shortpathComp-3.png" width="30%" /> <img src="presentation_files/figure-html/unnamed-chunk-16-1.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-16-2.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-16-3.png" width="30%" /> --- ### Betweenness centrality How many shortest paths pass through each node? .pull-left[ ```r graphs=list(sw=sw,scalefree=ba,random=rgg) allbetween=lapply(graphs,betweenness) aldst=range(sapply(allbetween,function(gr)range(density(gr,from=0)$y))) plot(1,1,type="n",ylim=aldst,xlim=range(unlist(allbetween)*1.1),main="compare betweenness centrality",xlab="centrality",ylab="") for(gr in seq_along(graphs)) lines(density(betweenness(graphs[[gr]]),from=0),lwd=3,col=gr) legend("topright",fill=adjustcolor(1:3,.4),legend=names(graphs)) ``` ] .pull-right[  ] --- ### Centrality measureS -- - Degree : which node has most in our out links -- - Betweenness : which mode has most SP going through it... -- - Page Rank : Google Algorithm -- - And mode ; how are they distributed? how 'centralised' is the network... --- Comparing degree & betweenness centrality <img src="presentation_files/figure-html/unnamed-chunk-17-1.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-17-2.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-17-3.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-17-4.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-17-5.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-17-6.png" width="30%" /> --- ### Clustering Coefficient, modularity and communities #### Clustering coefficient: .pull-left[ ```r # Creating a simple undirected graph with edge colors g <- graph.formula(A - B, C - D, D - A, B - D) # Assign colors to edges E(g)$color <- "red" E(g)$width <- 3 glayout=layout_in_circle(g) plot(g, edge.color=E(g)$color,layout=glayout) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Clustering coefficient: .pull-left[ ```r g_complete <- make_full_graph(vcount(g)) plot(g_complete, layout=glayout) plot(g, edge.color=E(g)$color,layout=glayout,add=T) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Clustering coefficient: .pull-left[ ```r # Calculate the global clustering coefficient global_cc <- transitivity(g, type="global") plot(g_complete, layout=glayout,main=paste0("clustering coeff (global):",global_cc)) plot(g, edge.color=E(g)$color,layout=glayout,add=T) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Clustering coefficient: .pull-left[ ```r # Calculate the global clustering coefficient local_cc <- transitivity(g, type="local") par(xpd=T) plot(g_complete, vertex.label="",vertex.size=0,layout=glayout,main=paste0("clustering coeff (global):",global_cc)) plot(g, edge.color=E(g)$color,layout=glayout,add=T,vertex.size=10) text(x=glayout[,1],y=glayout[,2],labels=paste("local cc=",round(local_cc,digit=2)),pos=c(4,3,2,1)) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Modularity: .pull-left[ ```r g <- make_graph(edges=c(1,2, 2,3, 3,1, 4,5, 5,6, 6,4, 1,4, 4,7, 5,7, 6,7 ), directed=FALSE) glay=layout_nicely(g) plot(g,layout=glay) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Modularity: .pull-left[ ```r membership <- c(1,1,1,2,2,2,2) md=modularity(g,membership) plot(g,vertex.color=membership,layout=glay,main=paste("modularity:",round(md,digit=2))) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Modularity: .pull-left[ ```r membership <- c(1,2,1,2,1,2,1) md=modularity(g,membership) plot(g,vertex.color=membership,layout=glay,main=paste("modularity:",round(md,digit=2))) ``` ] .pull-right[  ] --- ### Clustering Coefficient, modularity and communities #### Community detection ```r allgraphs=list(sw,ba,rgg) alllayouts=list(layout_in_circle,baln,rggln) for(i in seq_along(allgraphs)){ gr=allgraphs[[i]] lay=alllayouts[[i]] clgr=cluster_louvain(gr) gr$palette=categorical_pal(8) V(gr)$color=clgr$membership plot(gr,layout=lay,main=paste0("clustering:",round(transitivity(gr),digit=2),", modularity:",round(modularity(clgr),digit=2))) } ``` <img src="presentation_files/figure-html/unnamed-chunk-18-1.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-18-2.png" width="30%" /><img src="presentation_files/figure-html/unnamed-chunk-18-3.png" width="30%" /> --- class: inverse,middle,center # Moving back to real world -- ## The Zachary's Karate Club --- ### The Zachary's Karate Club Links between 34 members of a karate club. Given the club's small size, each club member knew everyone else. Sociologist Wayne Zachary documented 79 pairwise links between members who regularly interacted outside the club. -- .pull-left[  ] -- .pull-right[  ] --- ### The Zachary's Karate Club .pull-left[ Conflict and split: - A conflict between the club’s president and the instructor split the club into two. - About half of the members followed the instructor ad the other half the president, a breakup that unveiled the ground truth, representing club's underlying community structure. - Today community finding algorithms are often tested based on their ability to infer these two communities from the structure of the network before the split. ] -- .pull-right[  ] --- ### The club of Zachary's karate club .pull-left[ <div style="height: 100%;width:250px"> <blockquote class="twitter-tweet" " ><p lang="en" dir="ltr">This is the icing on the cake! I received the Zachary Karate Club Club trophy 🏆 for my talk in <a href="https://twitter.com/MscxNetworks?ref_src=twsrc%5Etfw">@MscxNetworks</a>! Thank you <a href="https://twitter.com/PiratePeel?ref_src=twsrc%5Etfw">@PiratePeel</a> for carrying it with you to Salina! <a href="https://t.co/153e3LBU9W">pic.twitter.com/153e3LBU9W</a></p>— Clara GM (@claragranell) <a href="https://twitter.com/claragranell/status/1038022679545176064?ref_src=twsrc%5Etfw">September 7, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </div> ] .pull-right[ <div style="height: 100%;width:250px"> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Today I had the opportunity to meet the 2023 winner of the prestigious Zachary Karate Club Award. Congratulations to <a href="https://twitter.com/l_gajo?ref_src=twsrc%5Etfw">@l_gajo</a> for the impressive achievement! Well deserved <a href="https://twitter.com/hashtag/netsci2023?src=hash&ref_src=twsrc%5Etfw">#netsci2023</a> <a href="https://twitter.com/netsci2023?ref_src=twsrc%5Etfw">@netsci2023</a> <a href="https://t.co/Vo5Fon3PjB">pic.twitter.com/Vo5Fon3PjB</a></p>— Leonardo Rizzo (@LnrdRizzo) <a href="https://twitter.com/LnrdRizzo/status/1678407578504626176?ref_src=twsrc%5Etfw">July 10, 2023</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </div> ] --- ### Visualisation .pull-left[ ```r zach <- make_graph("Zachary") plot(zach,vertex.size=30,layout=lay,xlim=range(lay[,1]),ylim=range(lay[,2]),rescale=F) ``` ] .pull-right[  ] --- ### Who are the 'important' nodes? Degree of the nodes .pull-left[ ```r degree(zach) ``` ``` ## [1] 16 9 10 6 3 4 4 4 5 2 3 1 2 5 2 2 2 2 2 3 2 2 2 5 3 3 2 4 3 4 4 6 12 17 ``` ] -- .pull-right[  ] [//]: # (```{r}) [//]: # (ggraph(zach, 'igraph', layout=lay,circular = F) + ) [//]: # (geom_edge_link() +) [//]: # (coord_fixed() + ) [//]: # (geom_node_point( color = 'steelblue', size = degree(zach)) +) [//]: # (ggforce::theme_no_axes()) [//]: # (```) --- ### Who are the 'important' nodes? betweenness centrality: number of shortest paths through a vertex .pull-left[ ```r btw=betweenness(zach) print(btw) ``` ``` ## [1] 231.0714286 28.4785714 75.8507937 6.2880952 0.3333333 15.8333333 15.8333333 0.0000000 29.5293651 ## [10] 0.4476190 0.3333333 0.0000000 0.0000000 24.2158730 0.0000000 0.0000000 0.0000000 0.0000000 ## [19] 0.0000000 17.1468254 0.0000000 0.0000000 0.0000000 9.3000000 1.1666667 2.0277778 0.0000000 ## [28] 11.7920635 0.9476190 1.5428571 7.6095238 73.0095238 76.6904762 160.5515873 ``` ```r btw=betweenness(zach) V(zach)$color=20+btw/3 zach$palette=rev(colorRampPalette(c("red","blue"))(max(btw/3+20))) plot(zach,vertex.size=20+btw/3,layout=lay,xlim=range(lay[,1]),ylim=range(lay[,2]),rescale=F,vertex.label=NA) ``` ] -- .pull-right[  ] --- --- ### Degree Distribution ```r hist(dgre, breaks=1:vcount(zach)-1, main="Histogram of node degree: Zach") hist(btw,breaks=20 , main="Histogram of node degree: Zach") ``` <img src="presentation_files/figure-html/unnamed-chunk-21-1.png" width="45%" /><img src="presentation_files/figure-html/unnamed-chunk-21-2.png" width="45%" /> --- ### Community Detection - Community detection based on edge betweenness: High-betweenness edges are removed sequentially (recalculating at each step) and the best partitioning of the network is selected. - Community detection based on modularity : split my group until finding split that maximise moudlarity -- ```r ceb <- cluster_edge_betweenness(zach) clo <- cluster_louvain(zach) plot(ceb,zach,layout=lay) plot(clo,zach,layout=lay) ``` <img src="presentation_files/figure-html/unnamed-chunk-22-1.png" width="50%" /><img src="presentation_files/figure-html/unnamed-chunk-22-2.png" width="50%" /> --- ### Visualize results: .pull-left[ <!-- --> ] -- .pull-left[  ] --- class: inverse,middle,center # And in Archaeology? --- ### Example and application -- .small-leftm[ <img src="images/archnetsci_bookcover.png" alt="CDAL" width="200px"> From Brughmans & Peeples 2023 ] -- .small-leftm[ - What can be our nodes? {{content}} ] -- - What can be our edges? {{content}} -- - What hypotheses can we explore? {{content}} -- - Which metrics to represent them? -- .small-leftm[ <img src="images/refMetricsTab.png" alt="CDAL" width="280"> <small style='font-size:5pt'>(From Amati et al. 2020)</small> ] --- ### Example and application -- #### Geographical aspect: Visibility maps/distance/least cost path.... <img src="images/tomvisu.jpg" alt="CDAL" height="200"> -- <img src="images/tomDensity.jpg" alt="CDAL" height="200"> <small style='font-size:5pt'> (From Brughmans & Brandes 2017)</small> -- .center[ <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3277.648135892445!2d-61.05046062492987!3d16.32169315631034!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x8c6cc6b4feafb7c7%3A0x60d7aa9da94e6af0!2sMorne%20Souffleur!5e1!3m2!1sen!2suk!4v1709127838637!5m2!1sen!2suk" width="300" height="225" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> ] --- ### Example and application #### Geographical aspect: Visibility maps/distance/least cost path.... <img src="images/tomvisu.jpg" alt="CDAL" height="200"> <img src="images/tomDensity.jpg" alt="CDAL" height="200"> <small style='font-size:5pt'> (From Brughmans & Brandes 2017)</small> #### Production/consumption: -- <img src="images/mapLHLP.png" alt="full map" width="200"> <img src="images/networkBicoucheWoSevIt.png" alt="multilay" width="380"> --- ### Example and application Between sites similarity : -- Counting artefacts between site, which artefact do they share or not? Dissimilarity/Similiarity matrix. -- Metal Artefact: .center[ <img src="images/metartefact.png" width="460"> ] -- .small-leftm[ <img src="images/metalnet.png" width="220"> ] -- .small-leftm[ <img src="images/metalcomu.png" width="220"> ] -- .small-leftm[ - decoration - type of burial - presence absence - Brainerd Robinson and other index (Simpson diversity,....) {{content}} ] -- - [https://github.com/simoncarrignon/bronze-age-ssr](github.com/simoncarrignon/bronze-age-ssr) --- ### Problems & Limitation Easy tool/Great visualisation/Simplify complex dataset & problems <video width="800" controls autoplay> <source src="images/1240064s2.mov" type="video/mp4"> </video> --- ### Problems & Limitation -- - Prignano et al. 2017: similarity metrics -- - Daems et al. 2023: time averaging -- - ... --- ### Time Averaging --- ### Incomplete Networks .small-left[ <p><a href="https://commons.wikimedia.org/wiki/File:Internet_map_1024.jpg#/media/File:Internet_map_1024.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/d/d2/Internet_map_1024.jpg" alt="Internet map 1024.jpg" width="280"></a><br><small style='font-size:5pt'> by Matt Britt using data from the OPTE project</small> ] -- .small-left[ <small> Real, but complete network {{content}} ] -- In archaeology? </small> -- .small-left[  ] -- .small-left[  ] --- <img src="presentation_files/figure-html/unnamed-chunk-24-1.png" width="20%" /><img src="presentation_files/figure-html/unnamed-chunk-24-2.png" width="20%" /><img src="presentation_files/figure-html/unnamed-chunk-24-3.png" width="20%" /><img src="presentation_files/figure-html/unnamed-chunk-24-4.png" width="20%" /><img src="presentation_files/figure-html/unnamed-chunk-24-5.png" width="20%" /><img src="presentation_files/figure-html/unnamed-chunk-24-6.png" width="20%" /><img src="presentation_files/figure-html/unnamed-chunk-24-7.png" width="20%" /> --- --- class:middle,center <img src="presentation_files/figure-html/unnamed-chunk-25-1.png" width="40%" /><img src="presentation_files/figure-html/unnamed-chunk-25-2.png" width="40%" /> <img src="presentation_files/figure-html/unnamed-chunk-26-1.png" width="40%" /><img src="presentation_files/figure-html/unnamed-chunk-26-2.png" width="40%" /> --- <img src="presentation_files/figure-html/unnamed-chunk-27-1.png" width="33%" /><img src="presentation_files/figure-html/unnamed-chunk-27-2.png" width="33%" /><img src="presentation_files/figure-html/unnamed-chunk-27-3.png" width="33%" /><img src="presentation_files/figure-html/unnamed-chunk-27-4.png" width="33%" /><img src="presentation_files/figure-html/unnamed-chunk-27-5.png" width="33%" /><img src="presentation_files/figure-html/unnamed-chunk-27-6.png" width="33%" /> --- class: inverse,center,middle # Take Home Message --- class: inverse,center,middle ## Networks are _nice_ -- ## Networks are _easy_ -- ## Networks are _powerful_ -- ## Networks are (were?) _hype_ -- #### Networks are _nice_: _easy_ to use & _powerful_, but don't let the (any) _hype_ fool you --