skip to Main Content

Using the vertex_stats() on the vertex of a graph we can load the contexts of the vertex in the graph. Where are they stored when they are loaded and what is the exact use of having the "stats" loaded? And how to make use of them?

2

Answers


  1. The vertex_stats() function provides important information about the degree and self-loop properties of vertices in a graph.

    {"id": 253327479, "label": "Person", "in_degree": 0, "out_degree": 1, "self_loops": 0}
    

    "in_degree": The number of edges that point into the vertex.
    "out_degree": The number of edges that point out of the vertex.
    "self_loops": The number of edges that connect the vertex to itself.
    

    These statistics can be useful for identifying important vertices in a graph, as highly connected vertices may be indicative of important nodes in a network.

    Additionally, the statistics can be used to optimize graph algorithms by providing information about the structure of the graph that can be used to optimize traversal or other graph operations.

    Login or Signup to reply.
  2. Using the vertex_stats() function, we can load the contexts of the vertex in the graph.
    Vertex_stats() is a function in Apache AGE. It is used to get states about any vertex in the graph.
    This function returns following details:

    id: ID of the Vertex
    label: Label Name of the Vertex
    in_degree: Number of in coming edges to the Vertex
    out_degree: Number of outgoing edges from the Vertex
    self_loops: Number of self-edges with itself
    
    {"id": 844424930131969, "label": "Person", "in_degree": 0, "out_degree": 0, "self_loops": 0}
    

    Where are they stored?
    This function do not tells us where they are stored, it just tells us the id.
    When they are loaded?
    This function do not tells us when the vertex was loaded.
    What is the exact use of having the "vertex_stats()" loaded?
    This function returns following details which can be used to execute some queries:

    id: ID of the Vertex
    label: Label Name of the Vertex
    in_degree: Number of incoming edges to the Vertex
    out_degree: Number of outgoing edges from the Vertex
    self_loops: Number of self-edges with itself
    

    And how to make use of them?
    You can use in this function in the following queries:

    1- Get all vertices that have more than 5 incoming edges (in_degress>5).
    2- Get all vertices that have more than 5 outcoming edges (out_degress>5).
    3- Delete all vertices that have no incoming edge (in_degress=0).
    4- Delete all vertices that have no outcoming edge (out_degress=0).
    5- Get all vertices that have more than 0 self-edges (self_loops>0).
    6- So on...
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search