小编Jun*_* su的帖子

从集合中查找断开图的算法

目标:希望从大量集合中有效地查找所有断开连接的图形

例如,我有一个如下所示的数据文件:

A, B, C
C, D, E
A, F, Z
G, J
...
Run Code Online (Sandbox Code Playgroud)

每个条目代表一组元素.第一个条目A,B,C = {A,B,C}这也表明A和B,A和C,B和C之间存在边缘.

我最初提出的算法如下

1.parse all the entries into a list:
[
{A,B,C}
{C,D,E}
...
]
2.start with the first element/set of the list can called start_entry, {A,B,C} in this case
3.traverse other element in the list and do the following:
     if the intersection of the element and start_entry is not empty
          start_entry = start_entry union with the element
          remove element from the list
4.with the …
Run Code Online (Sandbox Code Playgroud)

python algorithm graph

4
推荐指数
1
解决办法
897
查看次数

如何修复运行时错误:dlpack 不支持 Bool 类型

我一直使用下面的代码来获取DGL提供的默认Cora数据集,但是今天突然出现了以下错误。

该代码在 CoLab(python 3.7 和 Pytorch 后端)中运行。我相信这是 DGL 更新中的错误(因为它之前一直有效)。但是,我只是想知道我们是否可以做些什么来解决这个问题?

谢谢。

在此输入图像描述

python pytorch google-colaboratory dgl

2
推荐指数
1
解决办法
2281
查看次数

如何在朱莉娅中声明矢量矢量

我想在Julia中声明一个矢量向量,如下所示

V = [v1,v2,v3,...]其中v1,v2,v3 ......的维数为K x 1

实现这个的语法是什么?

syntax julia

1
推荐指数
2
解决办法
1832
查看次数

标签 统计

python ×2

algorithm ×1

dgl ×1

google-colaboratory ×1

graph ×1

julia ×1

pytorch ×1

syntax ×1