修改密码

请输入密码
请输入密码 请输入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

v5.0
搜索
    v5.0

      AA指标

      HDC

      概述

      AA指标(Adamic-Adar Index)是以其提出者Lada Adamic和Eytan Adar命名的节点相似度指标。该指标基于图中两个节点的共同邻居来衡量它们之间的潜在连接强度。

      AA指标的基本思想是,度数较低的共同邻居能为两个节点间的相似度提供更有价值的信息,而度数较高的共同邻居则不然。它的计算公式如下:

      其中,N(u)是与节点u相连的节点集合。对于两个节点的每个共同邻居u,AA指标首先计算其度数|N(u)|的对数的倒数,然后将所有共同邻居的这些倒数值相加。

      AA 指标分值较高表示节点间的相似度较大,分值为0则表示两个节点间没有相似性。

      在上图中,N(D) ∩ N(E) = {B, F},其中1log|N(B)| = 1log4 = 1.6610,1log|N(F)| = 1log3 = 2.0959,因此AA(D,E) = 1.6610 + 2.0959 = 3.7569。

      特殊说明

      • AA指标算法忽略边的方向,按照无向边进行计算。

      示例图集

      创建示例图集:

      // 在空图集中逐行运行以下语句
      insert().into(@default).nodes([{_id:"A"}, {_id:"B"}, {_id:"C"}, {_id:"D"}, {_id:"E"}, {_id:"F"}, {_id:"G"}])
      insert().into(@default).edges([{_from:"A", _to:"B"}, {_from:"B", _to:"E"}, {_from:"C", _to:"B"}, {_from:"C", _to:"D"}, {_from:"C", _to:"F"}, {_from:"D", _to:"B"}, {_from:"D", _to:"E"}, {_from:"F", _to:"D"}, {_from:"F", _to:"G"}])
      

      创建HDC图集

      将当前图集全部加载到HDC服务器hdc-server-1上,并命名为 hdc_tlp

      CALL hdc.graph.create("hdc-server-1", "hdc_tlp", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "undirected",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      })
      

      hdc.graph.create("hdc_tlp", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "undirected",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      }).to("hdc-server-1")
      

      参数

      算法名:topological_link_prediction

      参数名
      类型
      规范
      默认值
      可选
      描述
      ids []_id / / 通过_id指定参与计算的第一组点;若未设置则计算所有点
      uuids []_uuid / / 通过_uuid指定参与计算的第一组点;若未设置则计算所有点
      ids2 []_id / / 通过_id指定参与计算的第二组点;若未设置则计算所有点
      uuids2 []_uuid / / 通过_uuid指定参与计算的第二组点;若未设置则计算所有点
      type String Adamic_Adar Adamic_Adar 指定待计算的相似度类型;计算AA指标时,设置为Adamic_Adar
      return_id_uuid String uuid, id, both uuid 在结果中使用_uuid_id或同时使用两者来表示点
      limit Integer ≥-1 -1 限制返回的结果数;-1返回所有结果

      文件回写

      CALL algo.topological_link_prediction.write("hdc_tlp", {
        params: {
          ids: ["C"],
          ids2: ["A","E","G"],
          return_id_uuid: "id"
        },
        return_params: {
          file: {
            filename: "aa.txt"
          }
        }
      })
      

      algo(topological_link_prediction).params({
        projection: "hdc_tlp",
        ids: ["C"],
        ids2: ["A","E","G"],
        return_id_uuid: "id"
      }).write({
        file: {
          filename: "aa.txt"
        }
      })
      

      结果:

      _id1,_id2,result
      C,A,1.66096
      C,E,3.32193
      C,G,2.0959
      

      完整返回

      CALL algo.topological_link_prediction("hdc_tlp", {
        params: {
          ids: ["C"],
          ids2: ["A","C","E","G"],
          type: "Adamic_Adar",
          return_id_uuid: "id"
        },
        return_params: {}
      }) YIELD aa
      RETURN aa
      

      exec{
        algo(topological_link_prediction).params({
          ids: ["C"],
          ids2: ["A","C","E","G"],
          type: "Adamic_Adar",
          return_id_uuid: "id"
        }) as aa
        return aa
      } on hdc_tlp
      

      结果:

      _id1 _id2 result
      C A 1.660964
      C E 3.321928
      C G 2.095903

      流式返回

      MATCH (n)
      RETURN collect_list(n._id) AS IdList
      NEXT 
      CALL algo.topological_link_prediction("hdc_tlp", {
        params: {
          ids: ["C"],
          ids2: IdList,
          type: "Adamic_Adar",
          return_id_uuid: "id"
        },
        return_params: {
          stream: {}
        }
      }) YIELD aa
      FILTER aa.result >= 2
      RETURN aa
      

      find().nodes() as n
      with collect(n._id) as IdList
      exec{
        algo(topological_link_prediction).params({
          ids: ["C"],
          ids2: IdList,
          type: "Adamic_Adar",
          return_id_uuid: "id"
        }).stream() as aa
        where aa.result >= 2
        return aa
      } on hdc_tlp
      

      结果:

      _id1 _id2 result
      C D 3.756867
      C E 3.321928
      C G 2.095903
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写