igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Custom directed weighted bipartite graphs


From: Tamás Nepusz
Subject: Re: [igraph] Custom directed weighted bipartite graphs
Date: Fri, 4 May 2012 23:20:35 +0200

Hi,  

The graph.incidence function in R does almost what you want, with the exception 
of the edge directions. The function will assign the numbers in your matrix to 
an edge attribute named "weight". Once you have the graph, you can find the ids 
of the edges with negative weights, get their endpoints, remove them and add 
them back after you have reversed them. (Make sure that you keep and negate the 
corresponding weights).
--  
T.


On Tuesday, 1 May 2012 at 10:54, İbrahim Mutlay wrote:

> Hi,
>  
> I have an incidence matrix, suppose it:
>  
> R1 R2 R3
> A -1 0 -1
> B 1 -1 0
> C -1 -1 0
> D 0 1 1
> E 0 0 1
>  
> I would like to build a bipartite graph in igraph by following rules:
> - Edge directions should be determined by sign, i.e. when matrix entry is 
> negative then direction is row-to-column, if it is positive then inverse 
> direction. For example in first column, A and C connect to R1 but R1 connects 
> to B.
> - Graph should allow m<-1 and m>1 matrix entries for example -2, 3, etc. If 
> this is the case, I wonder does igraph evaluate them as weight or attribute?
>  
> Best wishes.
>  
> İbrahim Mutlay
> Chief Science Officer
> Grafen Chemical Industries
> A Subsidiary of Hayzen Engineering Co.
> 24. cad. KA-CL Is Merkezi
> No: 165/60 Ivedik OSB-Industrial Zone
> 06370 Ankara, TURKEY
> www.grafen.com.tr (http://www.grafen.com.tr)
> Phone/Fax: +90-312-3948109
> Mobile: +90-535-3033507
>  
> _______________________________________________
> igraph-help mailing list
> address@hidden (mailto:address@hidden)
> https://lists.nongnu.org/mailman/listinfo/igraph-help






reply via email to

[Prev in Thread] Current Thread [Next in Thread]