> For the complete documentation index, see [llms.txt](https://svai.gitbook.io/research-to-the-people/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://svai.gitbook.io/research-to-the-people/ai-fundamentals/networks-another-type-of-ml-topic.md).

# Networks: Another type of ML topic

> Reference for this section can be found [here](https://www.commonlounge.com/discussion/eb94b975321f4c0295c891ee4ebcf4fe)**.**

**A network** is a collection of objects (nodes) with relationships / interconnections (edges) between them. The most common and easy method to represent networks is by using **graphs,** which can be **directed** or **undirected** graphs.&#x20;

We can measure the importance of nodes via either three approaches: **degree centrality, closeness centrality, and betweenness centrality.**

### **Degree Centrality**

The nodes can be described by **degree centrality.** The intuition is that **nodes that are important have many connections.** Mathematically the degree centrality of a node in an undirected graph is given by,

​![](https://lh6.googleusercontent.com/SFosnHSr_HGSPB8uH9nTXObdvYkkXZ1iUo-pIEhX8jO9lxaHKaLmtPot-Zaii_-SLlJOVFZRHhTNWzHZB1K-6vaMq9vUIGtxeZlmVcRryH0GArKLPAa7PpWtMTheSLbwHJiG2VKz)​

where N is the number of nodes in the network and d is the degree of the node (number of connections).

### Closeness centrality

![](https://lh6.googleusercontent.com/eXzpDLW-uflLMlABDfE7QPSbkaGlWhRAoQVy2lHFspun9O5HpMEdQwB6OVLLr50RbpqR60oMfFCt3gWYqYvJ3Y_m9zuXkGRRy_56Oz-BUWDzk_Mj7Og2srlc5DpHGSRz_v09GMA8)

### **Betweenness centrality**

Under this approach, the assumption is that important nodes connect other nodes i.e they lie in between many nodes. For every pair of nodes in a connected graph, we consider the shortest path between the nodes. The betweenness centrality for a particular node is the number of these shortest paths that pass through the vertex.

### **Applications/Tool box**

A great application of networks is the [**page rank algorithm.**](https://en.wikipedia.org/wiki/PageRank)

**NetworkX** is a python library for analyzing graphs and networks. [Here's](https://www.commonlounge.com/discussion/eb94b975321f4c0295c891ee4ebcf4fe#networkx-for-data-analysis​) an example application.
