Knowledge graph interactive circle layer layout method

By calculating the concentric circle value using the K-shell algorithm and combining it with concentric circle layout and interactive diffusion, the problem that existing graph layouts cannot clearly display the importance of nodes and hierarchical relationships is solved, enabling rapid understanding and free exploration in knowledge graphs.

CN117808087BActive Publication Date: 2026-11-24BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410003487.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2026-11-24
Estimated Expiration
2044-01-02

AI Technical Summary

Technical Problem

Existing graph layout methods cannot clearly display the importance of nodes and hierarchical relationships, lack interactive flexibility, and make it difficult to quickly understand core content in complex knowledge graph structures.

Method used

The K-shell algorithm is used to calculate the concentric circle value, and the nodes are arranged based on the concentric circle value. Concentric circle layout and interactive node diffusion operation are used to display the importance and hierarchical relationship of the nodes through layout animation, and user interaction is provided to freely explore the graph.

Benefits of technology

The concentric circle layout clearly expresses the importance and hierarchical relationship of nodes, and provides an interactive node diffusion effect to help users quickly understand and freely browse complex knowledge graph structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117808087B_ABST
    Figure CN117808087B_ABST
Patent Text Reader

Abstract

This invention provides an interactive layered layout method for knowledge graphs, belonging to the field of knowledge graph visualization. The method includes: drawing preparation, such as initializing the canvas and coordinate system, acquiring knowledge graph node and relationship data, and calculating knowledge graph node layers; initializing the layout, grouping knowledge graph nodes according to layer values, calculating the coordinates of each node in the layered layout, and drawing the nodes based on the coordinates; and incremental layout, where, based on the initial layout, user interaction triggers knowledge graph node diffusion, obtaining incremental data on related nodes and relationships in the knowledge graph, and introducing force-guided re-layout of the new and old nodes after diffusion to achieve interactive node diffusion. This method clearly displays the importance and hierarchical relationships of different nodes in the knowledge graph, while providing users with interactive node diffusion capabilities, facilitating free browsing and exploration of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph visualization, specifically to an interactive layered layout method for knowledge graphs. Background Technology

[0002] Knowledge graph visualization presents the complex structure of entities and relationships within a knowledge graph in a graphical form, helping people to intuitively understand the content of the knowledge graph. In graph visualization, the layout determines the positional relationship of graph nodes and edges on the canvas. Traditional graph layouts include mechanics-oriented layouts, tree layouts, and clustering layouts, but these layouts have certain limitations in terms of layout stability, clarity of key node hierarchy, and layout update effectiveness.

[0003] The K-shell algorithm is a graph theory algorithm used to calculate the importance of nodes in complex networks. It works by peeling away the nodes with the lowest degree layer by layer, assigning each node a layer value. A larger layer value indicates a more complex adjacency pattern within the network, thus revealing the network's core structure. While research on the K-shell algorithm is relatively mature, methods for graph layout based on the layer values ​​obtained from the K-shell algorithm are still lacking. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides an interactive layered layout method for knowledge graphs. Based on the layer values ​​obtained through the K-shell algorithm, nodes are arranged to meet the following characteristics: (a) nodes with the same layer value are evenly arranged on the same circumference; (b) nodes with different layer values ​​are arranged on concentric circles of different radii, with the layer value increasing and the circle radius decreasing, presenting a graph node arrangement from the center outwards, reflecting the importance of different nodes; (c) An interactive node diffusion operation is provided, incrementally displaying the neighboring nodes of a given node, and using layout animation to achieve the visual effect of other related nodes spreading out from that node. This method solves the problem that existing graph layout methods cannot clearly display the importance and hierarchical relationships of nodes, and has a certain degree of interactive flexibility, facilitating free exploration of the graph by users.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] An interactive layered layout method for knowledge graphs includes the following steps:

[0007] Preparatory work for drawing includes initializing the canvas and coordinate system, acquiring knowledge graph node and relation data, and calculating knowledge graph node layer values.

[0008] Initialize the layout, group the knowledge graph nodes according to the circle value, calculate the coordinates of each node in the circle layout for each group, and draw the nodes according to the coordinates;

[0009] Incremental layout, based on the initial layout, triggers the diffusion of knowledge graph nodes through user interaction, obtains incremental data on relevant nodes and relationships in the knowledge graph, and introduces node quality into the new and old nodes after the node diffusion for force-oriented re-layout, realizing interactive node diffusion.

[0010] The beneficial effects of this invention are as follows:

[0011] This approach expresses the importance and hierarchical relationships of different nodes in a knowledge graph, arranging nodes in concentric circles. Nodes closer to the center hold a more central position in the knowledge graph, helping users quickly understand and master core content within its complex structure. It also provides interactive elements, allowing users to start from a specific node and view related nodes and relationships. The layout is rearranged to create a visually expanding effect, facilitating intuitive and free browsing and exploration within the knowledge graph. Attached Figure Description

[0012] Figure 1 This is a schematic diagram of an interactive layered layout for a knowledge graph according to the present invention;

[0013] Figure 2 This is a flowchart of an interactive layered layout method for knowledge graphs according to the present invention.

[0014] Figure 3 This is a rendering of an interactive layered layout for a knowledge graph according to the present invention. Detailed Implementation

[0015] The present invention will be further described below with reference to specific embodiments.

[0016] like Figure 1 The diagram illustrates an interactive layered layout for a knowledge graph according to the present invention. Each small dot represents a node, the number within the dot is the node's layer value, and the lines connecting nodes represent relationships. The dashed rings form the layer background, with nodes of the same layer value arranged on the same ring to form a layered layout. When a user clicks on a node, it triggers node expansion, as shown by the dashed outline of the dots and lines in the diagram. The newly expanded nodes and relationships are then rearranged and displayed around the clicked node.

[0017] like Figure 2 As shown, the knowledge graph interactive layer layout method proposed in this invention includes three steps:

[0018] Step 1: Drawing preparation, including canvas and coordinate system initialization, knowledge graph node and relationship data acquisition, and node layer calculation.

[0019] Step 2: Initialize the layout, group the nodes according to the layer value, calculate the coordinates of each node in the layer layout for each group, and draw the nodes according to the coordinates.

[0020] Step 3, incremental layout: Based on the initial layout, node diffusion is triggered by user interaction to obtain incremental data of relevant nodes and relationships in the knowledge graph. After the node diffusion, the node quality is introduced to the new and old nodes for force-oriented re-layout, achieving the visual effect of interactive node diffusion.

[0021] Step 1, drawing preparation, specifically includes:

[0022] (1) Initialize the canvas. The canvas width is `width` and the height is `height`. The canvas is the area for layout and drawing. Establish a polar coordinate system (r, θ) with the center of the canvas as the origin, and use the polar radius... The polar angle θ (0≤θ≤2π) can uniquely determine the position of the node to be drawn in the knowledge graph on the canvas, and the MIN operation is to take the minimum value;

[0023] (2) Configure a random seed, the see `d` is used to generate a pseudo-random number sequence, assigning a random initial polar angle to each group of nodes with the same concentric layer value when drawing on the canvas. The random initial polar angle makes the arrangement of each group of concentric layer nodes on the canvas more staggered, making the overall layout flexible and beautiful. At the same time, the random initial polar angle is generated by a random seed, ensuring the consistency of the results when repeating the layout for the same input data.

[0024] (3) Obtain knowledge graph data, including knowledge graph nodes and relations obtained from graph databases or backend servers. The node set is represented as V = {v1, v2, ..., v...} n}, v i Let n be one of the nodes, and n be the total number of nodes. The relation set is represented as E = {e1, e2, ..., e...} m}, e i Let m be one of the relations, and m be the total number of relations.

[0025] (4) Calculate the layer value of each node in the knowledge graph. Using the node set V and the relation set E as input data, calculate the layer value of each node according to the K-shell algorithm to obtain the layer value set S = {s1, s2, ..., s}. max}, 1≤s1≤s2≤…≤s max Node v i The corresponding circle value shell(v) i)∈S.

[0026] Step 2, initializing the layout, specifically includes:

[0027] (5) Group the nodes according to their concentric circle values, and group nodes with the same concentric circle value together to obtain the grouped node set. in The value of the circle is s i The set of nodes that satisfies exist Figure 1 In the example shown, the nodes are divided into 3 groups according to the circle values ​​1, 2, and 3;

[0028] (6) Determine the radius of the central ring. Where d N Indicates the diameter of the node to be drawn. Let η be the set of nodes with the maximum concentric ring value, η be the scaling factor, and the size operation calculates the number of elements in the set. The radius of the central concentric ring determines the drawing position of the set of nodes with the maximum concentric ring value. In the calculation method, the scaling factor η can be configured by the user. To ensure that nodes do not overlap, η is usually set to > 1. The larger η is, the looser the arrangement of nodes. The calculation yields... After that, the layer value is from s1 to s max The nodes will be distributed at a polar radius of On the ring, The MIN operation retrieves the minimum value.

[0029] (7) Generate a random number sequence in the range [0, 2π] based on the random seed. in The value of the circle is s i A set of nodes uses a random initial angle when drawing the concentric layout.

[0030] (8) Traverse set G, and the elements in set G The value of the circle is s i The set of nodes, corresponding to Figure 2 The process iterates through the concentric circles: if the iteration is complete, proceed to the next step; if the iteration is not complete, select one of the concentric circles with a value of s. i Node set The increment angle is determined based on the number of nodes in the set. After each node is drawn, the polar angle is determined according to... The intervals increase sequentially, causing the group of nodes to fall onto a ring. Then iterate through the set. right Each node v in jPositions in polar coordinate system Draw nodes, where the polar radius From the layer value s i Determined, the concentric circle values ​​[s1, s2] are determined by minimax normalization. max Mapped to The interval, plus the radius of the central ring, is obtained. Polar angle From a random initial angle and increasing angle composition, The layer value s in the previously generated random number sequence Θ i The corresponding item, As mentioned earlier, it is derived through calculation. If the set There are p nodes v1, v2, ..., v p For nodes Polar angle j is v1, v2, ..., v p The j-th node (1≤j≤p) is represented by mod, where mod is the modulo operation;

[0031] (9) Draw the background, such as Figure 1 The dotted circular section shown enhances the aesthetics and hierarchy of the layout, while adjusting the front-to-back relationship of nodes and edges on the canvas to prevent nodes from being obscured by connecting lines.

[0032] Step 3, incremental layout, specifically includes:

[0033] (10) The user clicks node v through interactive operation. spread Trigger node propagation operation, retrieve data from graph database or backend server related to v spread The associated knowledge graph data includes the newly added node set V new and the newly added set of relations E new The current set of all nodes is the union of the original nodes and the newly added nodes, which can be represented as V′=V∪V new The set of old nodes that existed before node diffusion is represented as the difference between the two, i.e., V. old =VV new ;

[0034] (11) For each node v in the current set of all nodes V′ i Assign a weight to the node:

[0035]

[0036] Where μ (μ≥1) is the node quality coefficient. The weight assigns different qualities to the old and new nodes before and after diffusion. Old nodes have higher quality and tend to remain fixed with minimal movement during the rearrangement; new nodes have lower quality and correspondingly move more during the rearrangement, creating the visual effect of new nodes spreading out from the old nodes. The node quality coefficient μ can be configured by the user; the larger μ is, the more pronounced the diffusion effect.

[0037] (12) Combining node quality, perform Force Atlas 2 force-directed layout on the current set of all nodes V′ to obtain the value of each node v. i The displacement is represented by Δr i For node v i The radial displacement in the polar coordinate system, Δθ i For node v i Displacement in the angular direction in polar coordinates:

[0038]

[0039]

[0040] Where Δt is the time step, and weight(v) i ) is node v i quality, F r (i, q) and F θ (i, q) represent nodes v i Influenced by other nodes v in the knowledge graph q The radial and angular components of the force in polar coordinates, v i ∈V′,v q ∈V′, i≠q. Node v i The new coordinates in the polar coordinate system are (r′) i , θ′ i ), These are the coordinates of the node in the polar coordinate system during the initial layout.

[0041] Figure 3 To achieve the interactive layered layout of the knowledge graph in this invention, clicking on a node will bring up a "Node Expansion" menu option. Clicking the option will then expand and rearrange the nodes.

[0042] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for interactive layered layout of knowledge graphs, characterized in that, Includes the following steps: Preparatory work for drawing includes initializing the canvas and coordinate system, acquiring knowledge graph node and relation data, and calculating knowledge graph node layer values. Initialize the layout, group the knowledge graph nodes according to the circle value, calculate the coordinates of each node in the circle layout for each group, and draw the nodes according to the coordinates; Incremental layout, based on the initial layout, knowledge graph nodes are diffused by user interaction, obtaining incremental data of related nodes and relationships in the knowledge graph. After the nodes diffuse, the node quality is introduced to the new and old nodes for force-oriented re-layout, realizing interactive node diffusion. The initial layout steps include: (5) Group the knowledge graph nodes according to their layer values, and group the nodes with the same layer value together to obtain the grouped node set. ,in The value of the circle is indicated. The set of nodes that satisfies , For the set of circle values; (6) Determine the radius of the central ring. , ,in Indicates the diameter of the node to be drawn. The value of the circle is The set of nodes, The scaling factor is used, and the `size` operation is used to calculate the number of elements in the set; the result is... After that, the circle value is arrive The nodes will be distributed at a polar radius of On the ring, The MIN operation retrieves the minimum value. (7) Based on the random seed ,exist Generate random number sequence within range ,in The value of the circle is indicated. A set of nodes uses a random initial angle when drawing the concentric layout. ; (8) Traverse the set of nodes G after grouping, and then traverse again. For sets Each node in Positions in polar coordinate system Draw nodes, where the polar radius From the layer value Determine that the concentric circle values ​​are obtained through max-min normalization. Mapped to The interval, plus the radius of the central ring, is obtained. polar angle From a random initial angle and increasing angle composition, For the previously generated random number sequence Middle layer value The corresponding item, If set There are p nodes For nodes polar angle j is The j-th node mod is the modulo operation; (9) Draw the background and adjust the relationship between the nodes and edges in the canvas; The incremental layout steps include: (10) Users click on nodes through interactive operations Trigger node propagation operation, retrieve data from graph database or backend server. The associated knowledge graph data, including the newly added node set and the newly added set of relationships The current set of all nodes The union of the original set of nodes V and the set of newly added nodes is denoted as: The set of old nodes that existed before node diffusion. It is represented as the difference set of the two sets, that is ; (11) is the set of all current nodes. Each node in Assigning quality to nodes : in, The node quality coefficient; (12) Combining node quality, perform a comprehensive analysis of the current set of all nodes. Perform Force Atlas 2 force-directed layout to obtain each node The displacement is represented by, For nodes Displacement in the radial direction in the polar coordinate system For nodes Displacement in the angular direction in polar coordinates: in, It is the time step. For nodes quality and They are nodes Influenced by other nodes in the knowledge graph The radial and angular components of the force in polar coordinates. ,node The new coordinates in the polar coordinate system are , , , ( , ) represents the coordinates of the node in the polar coordinate system during the initial layout.

2. The knowledge graph interactive layered layout method according to claim 1, characterized in that, The drawing preparation steps include: (1) Initialize the canvas, the canvas width is Canvas height is Establish a polar coordinate system with the center of the canvas as the origin. Through the polar radius and polar angle The MIN operation uniquely determines the position of the node to be drawn in the knowledge graph on the canvas, and takes the minimum value. (2) Configure random seed The seed is used to generate a pseudo-random number sequence, and assigns a random initial polar angle to each group of nodes with the same layer value when drawing on the canvas; (3) Obtain knowledge graph data, including knowledge graph nodes and relationships obtained from graph databases or backend servers. The node set is represented as... , As one of the knowledge graph nodes, Let be the total number of nodes, and the relation set be represented as . , For one of the relationships, This represents the total number of relations. (4) Calculate the layer value of each node in the knowledge graph, based on the node set. and relation set Using the K-shell algorithm as input data, the layer value of each node is calculated to obtain a set of layer values. , ,node Corresponding circle value .

Citation Information

Patent Citations

  • Recommendation method based on heterogeneous propagation collaborative knowledge awareness network

    CN111737592A

  • D3-based traditional Chinese medicine knowledge graph visualization method and system

    CN114064933A