Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.5K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How can I import a large dataset of vertex weights and edges?

Posted 12 years ago
Attachments:
POSTED BY: Shawn Doyle
4 Replies
Posted 12 years ago

The only problem with this code is that it doesn't create a weighted graph. I still have yet to find out how to assign the vertex weights. I thought that I would replace VertexSize with VertexWeight and remove the 0.1, but this does not work. How can I incorporate the weights?

POSTED BY: Shawn Doyle

Tá fáilte romhat!

Interesting by the way that the Wolfram Cloud thinks that this is English:

Classify["Language","Go raibh maith agat!"]

gives:

 Entity[Language, English]

Here in Aberdeen they speak Doric and "you are welcome" would be:

"nae bather"

(no bother) which the machine learning in the Cloud also believes to be English. I suppose that it isn't trained on Irish or Doric and Scots texts.

Cheers, Marco

POSTED BY: Marco Thiel
Posted 12 years ago

Go raibh maith agat!

POSTED BY: Shawn Doyle

Hi,

these two commands might help:

data = Import["~/Desktop/VEtest.xlsx"]

Graph[Table[Property[data[[1]][[i, 2]], VertexSize -> 0.1*data[[1]][[i, 1]]], {i, 1, Length[data[[1]]]}], 
 Table[data[[2]][[i, 1]] \[UndirectedEdge] data[[2]][[i, 2]], {i, 1, Length[data[[2]]]}]]

They give something like this:

enter image description here

The standard graph measures should work:

 g = Graph[Table[Property[data[[1]][[i, 2]], VertexSize -> 0.1*data[[1]][[i, 1]]], {i, 1, Length[data[[1]]]}],
    Table[data[[2]][[i, 1]] \[UndirectedEdge] data[[2]][[i, 2]], {i, 1, Length[data[[2]]]}]];

GraphDiameter[g]

which gives 4.

Cheers, Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard