graph-modelling-language

Python igraph: delete vertices from a graph

瘦欲@ 提交于 2021-02-07 12:12:27
问题 I am working with enron email dataset and I am trying to remove email addresses that don't have "@enron.com" (i.e. I would like to have enron emails only). When I tried to delete those addresses without @enron.com, some emails just got skipped for some reasons. A small graph is shown below where vertices are email address. This is gml format: Creator "igraph version 0.7 Sun Mar 29 20:15:45 2015" Version 1 graph [ directed 1 node [ id 0 label "csutter@enron.com" ] node [ id 1 label "steve

Conceptual Modelling - Is my drawing correct ?

删除回忆录丶 提交于 2019-12-25 12:25:41
问题 I have a exam tomorrow and we have gotten a sample exam, but since there are no answers to this sample exam, Id thought Id ask here. So here we go, this is one of the questions Im not sure if ive done correctly: Q: Draw a conceptual model describing the following domain. In the domain there are monkeys and bananas. A Monkey can eat bananas BUT two monkeys can not eat the same banana. A(which I think is correct): http://gyazo.com/722ee8618bfee76ed9f616d45d800819 Now, the reason why I think my

reading a GML file with networkx (python) without labels for the nodes

北战南征 提交于 2019-12-23 22:16:58
问题 I have a long GML file (Graph Modelling Language) that i am trying to read with Networkx in Python. In the GML file, nodes don't have label, like this: graph [ node [ id 1 ] node [ id 2 ] edge [ source 2 target 1 ] ] I get an error when reading the file: G = nx.read_gml('simple_graph.gml') --------------------------------------------------------------------------- NetworkXError Traceback (most recent call last) <ipython-input-39-b1b319a08668> in <module>() ----> 1 G = nx.read_gml('simple

Read gml file in R

假装没事ソ 提交于 2019-12-11 06:17:42
问题 i have problem when i try to read a gml file of political books dataset. i use the command: hh=read.table("polbooks.gml") Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : la ligne 2 n'avait pas 2 éléments and when i use this one: library(multiplex) hh=read.gml("polbooks.gml") Erreur dans (grep("graphics", edg, fixed = TRUE)[(i - 1)] + 2):(grep("graphics", : argument NA / NaN i have this problem in every dataset ".gml" 回答1: you can do like this, g<-read.graph(

Convert GML file to adjacency matrix in matlab

喜你入骨 提交于 2019-12-10 17:48:30
问题 I have a GML file of a directed graph (Political blogs). I want to use this graph in Matlab as an adjacency matrix. How can I convert it? Thanks. 回答1: There is a sample code here for this purpose: %Extracting edges from gml file graph fileName = 'dolphins.gml'; inputfile = fopen(fileName); A=[]; l=0; k=1; while 1 % Get a line from the input file tline = fgetl(inputfile); % Quit if end of file if ~ischar(tline) break end nums = regexp(tline,'\d+','match'); if length(nums) if l==1 l=0; A(k,2)