最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

检查图形中是否存在边

SEO心得admin65浏览0评论
本文介绍了检查图形中是否存在边的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

检查Graphs.jl包中的图形中是否存在边的首选方法是什么?

What is the preferred method for checking whether an edge exists in a graph in the Graphs.jl package?

假设我们有一个GenericGraph G,我们想检查图中是否有边a-> b.我想拥有与has_edge(G, a, b)类似的东西,但似乎不存在.

Say we have a GenericGraph G and we want to check if an edge a->b is in the Graph. I would like to have something similar to has_edge(G, a, b) but that does not appear to exist.

我目前正在使用in(a, in_neighbors(b, G))进行检查,但这可能效率很低.

I am currently using in(a, in_neighbors(b, G)) to check, but that may be quite inefficient.

推荐答案

据我了解,是检查图形边缘的正常方法.这也不是效率不高的.

As far as I understand it, that is the normal way to check for an edge in a graph. It's not really inefficient either.

发布评论

评论列表(0)

  1. 暂无评论