Home » Machine Learning/Artificial Intelligence

# The boyfriend problem using PGMs and Neural Network

In this article, we will see that How **PGMS and neural network** are used to solve a problem and also to know which is the best algorithm which iseasy to use and to solve a problem?

Submitted by Bharti Parmar, on March 16, 2019

## PGM and Neural Network

Both are capable for inferencing and learning problem.

**Difference:** To get prior knowledge in the existing model. Like: we can constraint a PGM what can Neural network does and torcher a neural network to get some information PGM would naturally give you.

**The boyfriend Problem:** Here, we use both the algorithms and we see which is the more beneficial algorithm, for us to find a correct and solution of any problem easily in less time.

First we see what exactly a boyfriend problem is?

A girl like a guy that she knows through end no. of mutual friend and she want to ask him for a date. Now, she wants some guy who can boost her to him. Then,

- If any friend who is close to him and if he put some good words for her then it will have a strong positive influence.
- If someone says bad things about her to him then, he will not talk to her. Suppose, there are 'n' No. of friends then 'N' bit vector = {0,1,0,1,0,1……} is a boost where, 0 means No contact and 1 for contact.

Now, here we use both the algorithms to solve this problem:

**Objective:** Find the set of friends that she should ask to boost him that is a best vector.

**1) Neural network**

Now, if we take 3 top close friend in observation the chances is more to get accepted her proposal.

So, somehow she has to manage to do that then, neural network can act as an oracle.

Individually it will not give us a prediction, so, here we use neural network.

**2) PGMs**

In this 'N' No. of friends give her an approval to get accepter or rejecter (it will leave her for an impression) it is called random variable.

P(impression / vector of all approval) ← P(approval from friend / impression)

P(all approval / impression) = product of all P (approval / impression)

So, this is very simple and best to solve this problem.

**Conclusion:** In this article, we have learnt that **how PGMs and neural network are solving any problem and which is best to use by using boyfriend problem**? We will know more about ML in the upcoming articles. Have a Nice day! Happy Learning!

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.