MulaiMulai sekarang secara gratis

Cliques

Identifying cliques is a common practice in undirected networks. In a clique every two unique nodes are adjacent - that means that every individual node is connected to every other individual node in the clique. In this exercise you will identify the largest cliques in the Forrest Gump network. You will also identify the number of maximal cliques of various sizes. A clique is maximal if it cannot be extended to a larger clique.

Latihan ini adalah bagian dari kursus

Network Analysis in R

Lihat Kursus

Petunjuk latihan

  • Identify the largest cliques in the network using the function largest_cliques().
  • Determine all the maximal cliques in the network using the function max_cliques(). Assign the output of this function to the list object clq.
  • Calculate the length of each of the maximal cliques. Use lapply() to loop through the object clq determining the length() of each object in the list. Then unlist() and use table() to observe how large each of the maximal cliques are.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

library(igraph)

# Identify the largest cliques in the network
___(g)

# Determine all maximal cliques in the network and assign to object 'clq'
clq <- ___(g)

# Calculate the size of each maximal clique.
table(unlist(lapply(___, length)))
Edit dan Jalankan Kode