Prerequisite: Introduction to Social Networks
In Social Networks, Network is of 2 types- Unsigned Network and Signed Network. In the unsigned network, there are no signs between any nodes, and in the signed network, there is always a sign between 2 nodes either + or -. The ‘+’ sign indicates friendship between 2 nodes and the ‘-‘ sign indicates enmity between 2 nodes.
Our task is to create a signed network on N nodes using python language.
- Create a graph and add nodes to it.
- Add every possible edge and assign a sign to it.
- Get a list of all possible triangles in a network.
- Store the sign details of all the triangles in the network.
- Count the total number of the unstable triangle in the network
- Now take an unstable triangle from the list and make it stable.
- Again count a number of the unstable triangles.
- Repeat steps 6 and 7 until there is no unstable triangle.
- Now form a coalition(friend nodes in coalition 1 with red color and enemy nodes in other coalition with blue color) and display the graph.
Below is the implementation.
['G', 'B', 'C', 'H'] ['A', 'D', 'E', 'F']
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Introduction to Social Networks using NetworkX in Python
- Implementation of Erdos-Renyi Model on Social Networks
- Emergence of connectedness in Social Networks
- Community detection in social networks using brute-force method
- Detecting communities in social networks using Girvan Newman algorithm in Python
- Fatman Evolutionary Model in Social Networks
- Spatial Segregation in Social Networks
- Cascading Behavior in Social Networks
- K-shell decomposition on Social Networks
- The concept of Social Computing in Python
- Detecting top nodes on a Social Network - The VoteRank Algorithm
- NetworkX : Python software package for study of complex networks
- Recurrent Neural Networks Explanation
- Long Short Term Memory Networks Explanation
- Gated Recurrent Unit Networks
- ML | Text Generation using Gated Recurrent Unit Networks
- ML | Transfer Learning with Convolutional Neural Networks
- Residual Networks (ResNet) - Deep Learning
- Dropout in Neural Networks
- Multiple Labels Using Convolutional Neural Networks
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.