My Math Forum Generating a linear system for popularity calculation

 Applied Math Applied Math Forum

 July 27th, 2017, 01:39 AM #1 Newbie   Joined: Jul 2017 From: Cagliari Posts: 1 Thanks: 0 Generating a linear system for popularity calculation This is a half mathematical half computer science question. I am working on matlab on a mathematical problem. I want to generate a linear system for the calculation of popularity of people (a vector $\displaystyle x$) in a generic social network, given a simple matrix of friendship $\displaystyle F$. If user 1 and user 2 are friends, $\displaystyle F(1,2)=1$ but also $\displaystyle F(2,1)=1$ (the friendship is bidirectional). To transform this problem in a linear system I need that the popularity value of a person ($\displaystyle x(i)$) and the popularity of all his friends ($\displaystyle ∀x(j) | F(i,j)=1 and j≠i$) are linearly dependent. So I wrote this simple formula $\displaystyle x(j) = sum(x(i) x n(i) x F(i,j)) ∀i≠j$ where $\displaystyle n(i)$ is the number of friends of i. For $\displaystyle size(x)=3$ the system is something like this Code:  -x(1) + f(1,2) n(2) x(2) + f(1,3) n(3) = 0 f(2,1) n(1) x(1) - x(2) + f(1,3) n(3) x(3) = 0 f(3,1) n(1) x(1) + f(1,2) n(2) x(2) - x(3) = 0 With this specific formula, there are two problems:With no constant term, the solution found is $\displaystyle x(i)=0 ∀i$ I need positive values of popularity, but this approach gave also some negative (and correct!) results. So I need a formula that doesn't have these two problems. The formula can be chosen arbitrarily because the problem is totally defined by me. It must take account of friendship relations and number of friends in a linear combination (necessary to get a linear system), but also be positive. Here the code of the generation and resolution of the system Code: n=10; F=triu(randi([0,1],n)); F=F-diag(diag(F)); F=F+F'; N=(sum(F))'; A=ones(n); for i=1:n A(:,i)=diag(N)*F(:,i); end A=A-eye(n); b=zeros(n,1); x=A\b Last edited by skipjack; July 27th, 2017 at 07:38 AM.

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post RGNIT Calculus 0 March 20th, 2014 11:21 PM 667 Applied Math 1 January 24th, 2014 08:31 AM ihavenoidea Applied Math 0 June 8th, 2013 09:20 AM tools Linear Algebra 1 September 21st, 2012 12:38 PM SidT New Users 1 June 27th, 2008 12:48 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top