How to create a graph object with source and target vectors having zero labels?

Hi,
I am using a real network data from stanford SNAP webpage. Some of the nodes are labeled zeros, so I got the following error when I used graph
"Error using matlab.internal.graph.MLGraph
Source must be a dense double array of positive integer node indices."
I tried to attach the double vector but its size exceed 5 MB. Also, since this data consists of millions of nodes and links, how can I exrtact a portion of the network with couple of thousands nodes ?

5 件のコメント

Image Analyst
Image Analyst 2022 年 6 月 1 日
Maybe run through all the nodes adding 1 to them?
Rayan Glus
Rayan Glus 2022 年 6 月 1 日
Thanks Doctor. I added 1 to all of two million nodes not only to the ones with label 0, created and plotted the graph (attached).
I couldn't save the plot as a fig though.
Rayan Glus
Rayan Glus 2022 年 6 月 1 日
Do you know how to extract any of the connected components (clusters) and exclude other clusters especially the isolated nodes?
Thanks
Steven Lord
Steven Lord 2022 年 6 月 1 日
This category page lists the operations you can perform on graph and/or digraph objects (a few of the operations only make sense for undirected graphs and a few only for directed graphs.)
conncomp and biconncomp in the Analyze Structure section look relevant to your question.
Rayan Glus
Rayan Glus 2022 年 6 月 5 日
Thanks Steven for referring me to conncomp documentation. I was able to preprocess my large graph and all is good now.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraph and Network Algorithms についてさらに検索

質問済み:

2022 年 6 月 1 日

コメント済み:

2022 年 6 月 5 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by