修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

搜索
    中文

      组网

      概述

      autonet().src().dest().depth()子句查询两组点之间规定长度的全部或部分路径,称为组网。组网是将两组中的点两两配对后进行AB路径查询,可以理解为ab()命令的批处理模式。

      通过调整参数dest()的使用,可实现两种组网模式:

      • 互组网:N个起点和M个终点两两组网,即进行N*M次AB路径查询
      • 自组网:N个点两两组网,即进行N(N-1)/2次AB路径查询
      互组网(左)和自组网(右)
      (每条连线代表一次AB路径查询)

      语法

      • 子句别名:支持,数据类型为PATH
      • 参数:
      参数
      类型 规范
      必须携带
      描述
      参数别名
      src() filter / 路径起点的过滤条件 支持,数据类型为NODE
      dest() filter / 路径终点的过滤条件;携带此参数是进行互组网查询,不携带此参数时进行自组网查询 支持,数据类型为NODE
      depth() range >0 路径长度填写格式:
      depth(N):N步
      depth(:N):1~N步
      depth(M:N):M~N步

      如果使用了shortest()参数,路径长度只能设置为固定值,即depth(N).shortest(),表示N步内最短路径
      不支持
      shortest() / / 查询N步内最短路径,此时depth()参数需填写固定值 不支持
      node_filter() filter / 中介点(非srcdest)的过滤条件 不支持
      edge_filter() filter / 所有边的过滤条件 不支持
      direction() string leftright 路径中所有边的方向 不支持
      no_circle() / / 剔除含有环路的路径;有关嬴图中环路的定义,可参考术语解释 不支持
      limit() int ≥-1 每次AB路径查询(注意不是组网子句每次执行时)返回的结果数量,-1表示返回所有 不支持

      示例

      示例图集

      在一个空图集中,依次运行以下各行语句创建示例图集:

      create().edge_property(@default, "weight", int32)
      insert().into(@default).nodes([{_id:"A", _uuid:1}, {_id:"B", _uuid:2}, {_id:"C", _uuid:3}, {_id:"D", _uuid:4}, {_id:"E", _uuid:5}, {_id:"F", _uuid:6}])
      insert().into(@default).edges([{_uuid:1, _from_uuid:1, _to_uuid:3, weight:1}, {_uuid:2, _from_uuid:5, _to_uuid:2 , weight:1}, {_uuid:3, _from_uuid:1, _to_uuid:5 , weight:4}, {_uuid:4, _from_uuid:4, _to_uuid:3 , weight:2}, {_uuid:5, _from_uuid:5, _to_uuid:4 , weight:3}, {_uuid:6, _from_uuid:2, _to_uuid:1 , weight:2}, {_uuid:7, _from_uuid:6, _to_uuid:1 , weight:4}])
      

      互组网 - 规定路径长度

      本例查找从点A、B到点D、E的1~3步路径,返回路径中点和边的全部信息:

      autonet().src({_id in ["A","B"]}).dest({_id in ["D","E"]}).depth(:3) as p
      return p{*}
      

      A --3--> E --5--> D
      A --1--> C <--4-- D
      A <--6-- B <--2-- E --5--> D
      A --3--> E
      A --1--> C <--4-- D <--5-- E
      A <--6-- B <--2-- E
      B --6--> A --3--> E --5--> D
      B --6--> A --1--> C <--4-- D
      B <--2-- E --5--> D
      B --6--> A --3--> E
      B <--2-- E
      

      互组网 - 无权重最短路径

      本例查找从点A、B到点D、E的3步内最短路径,返回路径中点和边的全部信息:

      autonet().src({_id in ["A","B"]}).dest({_id in ["D","E"]}).depth(3)
        .shortest() as p
      return p{*}
      

      A --1--> C <--4-- D
      A --3--> E --5--> D
      A --3--> E
      B <--2-- E --5--> D
      B <--2-- E
      

      互组网 - 限制查询数量

      本例查找从点A、B到点D、E的1~3步路径,每对节点最多返回1条路径,返回路径中点和边的全部信息:

      autonet().src({_id in ["A","B"]}).dest({_id in ["D","E"]}).depth(:3).limit(1) as p
      return p{*}
      

      A <--6-- B <--2-- E --5--> D
      A <--6-- B <--2-- E
      B <--2-- E --5--> D
      B <--2-- E
      

      自组网 - 规定路径长度

      本例查找点A、B、C自组网的1~3步路径,返回路径中点和边的全部信息:

      autonet().src({_id in ["A","B","C"]}).depth(:3) as p
      return p{*}
      

      A --3--> E --2--> B
      A <--6-- B
      A --3--> E --5--> D --4--> C
      A --1--> C
      B --6--> A --1--> C
      B <--2-- E --5--> D --4--> C
      B <--2-- E <--3-- A --1--> C
      

      自组网 - 无权重最短路径

      本例查找点A、B、C自组网的3步内最短路径,返回路径中点和边的全部信息:

      autonet().src({_id in ["A","B","C"]}).depth(3)
        .shortest() as p
      return p{*}
      

      A <--6-- B
      A --1--> C
      B --6--> A --1--> C
      

      自组网 - 限制查询数量

      本例查找点A、B、C自组网的1~3步路径,每对节点最多返回1条路径,返回路径中点和边的全部信息:

      autonet().src({_id in ["A","B","C"]}).depth(:3).limit(1) as p
      return p{*}
      

      A <--6-- B
      A --1--> C
      B <--2-- E <--3-- A --1--> C
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写