A universal interactive constraint graph layout system and layout method

The interactive constraint graph layout system supports users to customize diversified constraint types and parameters, and uses optimization algorithms to calculate graph layout results that meet user expectations. This solves the problem of insufficient support for constraint types in the existing technology and realizes the optimization of graph layout. Flexibility and user satisfaction.

CN115017367BActive Publication Date: 2024-09-13PEKING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210309772.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2024-09-13
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Existing graph data layout algorithms cannot fully meet users' custom constraint needs. In particular, they lack support for diverse constraint types and cannot obtain the graph layout results expected by users.

Method used

A general interactive constraint graph layout system is designed, including graph data preparation module, constraint module, modeling and calculation module and result display module. It supports users to customize various constraint types and parameters through interactive methods such as clicking and swiping. Define constraints such as selecting and moving nodes, and use stochastic gradient descent and gradient projection optimization algorithms to calculate graph layout results that meet user expectations.

Benefits of technology

It enables users to easily customize graph layout constraints, supports diversified constraint types and parameter adjustments, calculates graph layout results that meet user expectations through optimization algorithms, and satisfies user needs by highlighting constraint effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115017367B
    Figure CN115017367B
Patent Text Reader

Abstract

The present invention relates to a general interactive constraint graph layout system and layout method, belonging to the field of visualization technology, the system includes a graph data preparation module, a constraint module, a modeling and calculation module and a result display module, the user imports the original graph through the graph data preparation module, and selects the subgraph to be optimized from the original graph; the constraint module imposes constraints based on the node distance in graph theory on the nodes in the original graph, and the user customizes the constraint type and parameters for the nodes in the subgraph data selected by the user; the modeling and calculation module converts various constraints into different functions, and uses a suitable optimization algorithm to calculate the graph layout visualization result expected by the user; the scope of action of each constraint and the graph layout visualization result are displayed in the result display module. The system and method provided by the present invention can support users to conveniently customize constraints, obtain graph layout visualization results that meet the user's expectations, and facilitate users to understand the effect of constraints in the layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of visualization technology, and in particular relates to a general interactive constraint graph layout system and a layout method. Background Art

[0002] In the era of big data, visualization is an important means to help users understand and analyze data. Graph data is an important type of data, such as social networks, subway route maps, citation networks, etc. The classic stress minimization layout algorithm is to define the ideal distance between nodes in the graph, calculate the corresponding objective function, and obtain a beautiful graph layout result by optimizing the objective function. This method cannot fully meet the needs of users. In order to obtain the results expected by users, existing methods have proposed some graph layout technologies that support user-defined constraints, but due to the variety of constraint types, only some of the defined constraints can be supported. Summary of the invention

[0003] In order to solve the defects of the prior art, the purpose of the present invention is to provide a universal interactive constraint graph layout system and layout method. The layout system supports users to customize various constraint types, supports users to specify constraint types and action nodes through interaction, and can modify constraint parameters and intuitively display constraint effects.

[0004] In order to achieve the above purpose, a technical solution adopted by the present invention is:

[0005] A general interactive constraint graph layout system, the system comprising a graph data preparation module, a constraint module, a modeling and calculation module, and a result display module, wherein:

[0006] The graph data preparation module is used for the user to import original graph data and select sub-graph data that needs to be optimized from the original graph data;

[0007] The constraint module is used to impose constraints on nodes in the original graph data and subgraph data. For nodes in the original graph data, the constraint module uses the default shortest path algorithm to impose constraints based on node distances in graph theory. For nodes in the subgraph data selected by the user, the user can customize the constraint type and constraint parameters.

[0008] The modeling and calculation module is used to convert various types of constraints into different functional forms and use appropriate optimization algorithms to calculate the graph layout visualization results that meet the user's expectations;

[0009] Result display module: used to display the scope of each constraint and the graph layout visualization results in the graph layout view.

[0010] Further, in the general interactive constraint graph layout system as described above, the constraint module includes a basic constraint sub-module and a high-order constraint sub-module, the basic constraint sub-module is used to define basic constraints, and the basic constraints include position constraints, distance constraints, direction constraints and angle constraints; the high-order constraint sub-module is used to define high-order constraints, and the high-order constraints include high-order constraints based on position constraints, high-order constraints based on distance constraints, high-order constraints based on direction constraints and high-order constraints based on angle constraints; the high-order constraints can be deconstructed into the form of basic constraints.

[0011] Furthermore, in the general interactive constraint graph layout system as described above, each of the basic constraints includes two types: soft constraints and hard constraints. Soft constraints mean that the constraints can be approximately satisfied, and hard constraints mean that the constraints must be strictly satisfied. Constraints based on node distances in graph theory are only soft constraints.

[0012] Furthermore, in the general interactive constraint graph layout system described above, the modeling and calculation module converts various types of constraints into different functional forms, and uses a suitable optimization algorithm to calculate and obtain a graph layout visualization result that meets the user's expectations, specifically including the following situations:

[0013] The system converts the node distance constraint based on graph theory into the form of a default stress function, uses the stochastic gradient descent optimization algorithm to calculate the gradient of the stress function to the node position, and moves the node position according to the calculated gradient;

[0014] The system converts the user-defined high-order constraints into basic constraints, converts the soft constraints in the basic constraints into the form of objective functions, uses the stochastic gradient descent optimization algorithm to calculate the gradient of the objective function to the node position, and moves the node position according to the calculated gradient;

[0015] The system converts the user-defined high-order constraints into basic constraints, and converts the hard constraints in the basic constraints into the form of projection functions. The system uses the gradient projection optimization algorithm. If the node position satisfies the hard constraints, the node position will not be moved; if the node position does not satisfy the hard constraints, the node will be moved so that it satisfies the hard constraints, and the direction of the node movement can make the distance of this movement the shortest.

[0016] Furthermore, in the general interactive constraint graph layout system described above, when the user defines the nodes to be constrained and the constraint types and constraint parameters to be imposed, the system provides interactive methods including clicking, brushing, moving nodes, dragging bars and entering text.

[0017] Another technical solution adopted by the present invention is:

[0018] A general interactive constraint graph layout method, the method comprising the following steps:

[0019] S1. Importing original graph data, the user selects sub-graph data to be optimized from the original graph data;

[0020] S2. The user customizes the constraint type and constraint parameters for the nodes in the subgraph data according to actual needs;

[0021] S3. Each iteration traverses all defined constraints, and according to the constraint type, converts the defined constraints into different function forms. After multiple iterations using a suitable optimization algorithm, a graph layout visualization result that meets the user's expectations is obtained.

[0022] Further, in the general interactive constraint graph layout method as described above, the user-defined constraint types in step S2 include basic constraints and high-order constraints, the basic constraints include position constraints, distance constraints, direction constraints and angle constraints; the high-order constraints include high-order constraints based on position constraints, high-order constraints based on distance constraints, high-order constraints based on direction constraints and high-order constraints based on angle constraints; the high-order constraints can be deconstructed into the form of basic constraints.

[0023] Furthermore, in the general interactive constraint graph layout method as described above, each of the basic constraints includes two types: soft constraints and hard constraints. Soft constraints mean that the constraints can be approximately satisfied, and hard constraints mean that the constraints must be strictly satisfied. Constraints based on node distances in graph theory are only soft constraints.

[0024] Further, in the general interactive constraint graph layout method as described above, step S3 is specifically as follows:

[0025] The node distance constraint based on graph theory is converted into the form of the default stress function, and the gradient of the stress function to the node position is calculated using the stochastic gradient descent optimization algorithm, and the node position is moved according to the calculated gradient;

[0026] Convert the user-defined high-order constraints into basic constraints, convert the soft constraints in the basic constraints into the form of objective functions, use the stochastic gradient descent optimization algorithm to calculate the gradient of the objective function with respect to the node position, and move the node position according to the calculated gradient;

[0027] The user-defined high-order constraints are converted into basic constraints, and the hard constraints in the basic constraints are converted into the form of projection functions. The gradient projection optimization algorithm is used. If the node position meets the hard constraints, the node position is not moved; if the node position does not meet the hard constraints, the node is moved so that it meets the hard constraints, and the direction of the node movement can make the distance of this movement the shortest.

[0028] Further, in the general interactive constraint graph layout method as described above, in step S2, the user defines the nodes to be constrained and the constraint types and constraint parameters to be imposed in an interactive manner, and the interactive manner includes clicking, brushing, moving nodes, dragging bars and entering text.

[0029] The general interactive constraint graph layout system and layout method provided by the present invention have the following significant technical effects:

[0030] The present invention defines basic constraints and high-order constraints and uses an interactive interface to accept user input, such as clicking, swiping, moving nodes, entering text, etc., to support users in conveniently selecting subgraphs, customizing constraint types and adjusting constraint parameters. After converting user requirements into constraint conditions, the present invention calculates the graph layout visualization result that meets the user's expectations through the optimization algorithm. At the same time, the effect of the constraints in the graph layout is displayed in a highlighted form, which facilitates users to understand whether their requirements are met. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a general interactive constraint graph layout system framework diagram provided in an embodiment of the present invention;

[0032] Figure 2 is a schematic diagram of an interactive interface of a graph layout system provided in an embodiment of the present invention;

[0033] Figure 3 It is a schematic diagram of the expression of some basic constraints and high-order constraints defined in the constraint module;

[0034] Figure 4 is a schematic diagram of the graph layout without constraints;

[0035] Figure 5 It is a schematic diagram of the graph layout after constraints are imposed;

[0036] Figure 6 It is a flow chart of a general interactive constraint graph layout method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The present invention is further described below in conjunction with specific embodiments and the accompanying drawings.

[0038] Figure 1 A general interactive constraint diagram layout system framework diagram provided in an embodiment of the present invention is shown. Figure 2 The interactive interface of the system of the present invention is shown, and the system includes a graph data preparation module, a constraint module, a modeling and calculation module, and a result display module, wherein:

[0039] The graph data preparation module is used by users to import original graph data and select sub-graph data that needs to be optimized from the original graph data.

[0040] The constraint module is used to impose constraints on graph data. For nodes in the original graph data, the constraint module uses the default shortest path algorithm to impose constraints based on node distances in graph theory on these nodes; for nodes in the subgraph selected by the user, the user can customize the constraint type and constraint parameters for the selected node through the constraint module.

[0041] Users can define the nodes that need to be constrained and the types and parameters of constraints to be imposed by clicking, brushing, moving nodes, dragging bars, entering text, etc. in the interactive interface.

[0042] The constraint module includes a basic constraint submodule and a high-order constraint submodule. The basic constraint submodule is used to define basic constraints, including position constraints, distance constraints, direction constraints, and angle constraints. The high-order constraint submodule is used to define high-order constraints, including high-order constraints based on position constraints, high-order constraints based on distance constraints, high-order constraints based on direction constraints, and high-order constraints based on angle constraints. High-order constraints can be deconstructed into the form of basic constraints for subsequent modeling and calculation.

[0043] Each basic constraint includes two types: soft constraints and hard constraints. For example, distance constraints include soft distance constraints and hard distance constraints. Soft constraints mean that the constraint conditions can be approximately satisfied (that is, they do not have to be strictly satisfied), while hard constraints require that the constraint conditions are strictly satisfied. Constraints based on node distances in graph theory are only soft constraints.

[0044] Figure 3 The following figure shows the expression diagram of the basic constraints and some high-order constraints defined in the constraint module. The position constraint is defined on a single node, which means that the position of the node is constrained to be within a certain custom range. The distance constraint and direction constraint are defined between two nodes, which means that the distance between the two nodes and the direction of the line formed by the two nodes must be within a certain custom range. The angle constraint is defined between three nodes, which means that the angle formed by the three nodes must be within a certain custom range.

[0045] High-order constraints based on location constraints include clustering constraints, circular constraints, etc. Clustering constraints mean that nodes belonging to the same class should be as close to their centers as possible; circular constraints mean that some nodes have the same position to a center, which can be converted into location constraints.

[0046] High-order constraints based on distance constraints include subgraph constraints, average edge length constraints, node overlap constraints, etc. The subgraph constraint means that the distance between each node in the subgraph should be as close as possible to the distance given by the user; the average edge length constraint means that the lengths of the edges in the graph are as equal as possible; the node overlap constraint means that the nodes should not overlap with each other as much as possible. They can be converted into distance constraints.

[0047] High-order constraints based on directional constraints include longitudinal or transverse constraints, subway map constraints, edge crossing constraints, etc., where longitudinal or transverse constraints mean that the directions of directed edges between nodes are downward / upward / left / right as much as possible; subway map constraints mean that the directions of edges are vertical or horizontal as much as possible or at a 45-degree angle to them; edge crossing constraints mean that the edges between nodes should not cross as much as possible, and they can be converted into directional constraints.

[0048] High-order constraints based on angle constraints include ring constraints, star constraints, etc. The ring constraint means that the nodes are distributed as evenly as possible on a ring; the star constraint means that the central node and the surrounding nodes are distributed in a star shape.

[0049] The modeling and calculation module is used to convert various types of constraints into different functional forms, and then use appropriate optimization algorithms to calculate the graph layout visualization results that meet user expectations.

[0050] Use the appropriate optimization algorithm based on the constraint type, including the following situations:

[0051] 1) Constraints based on node distance in graph theory: This type of constraint is imposed by the system on nodes by default when there are no user-defined constraints. This type of constraint only has soft constraints. The system first converts this type of constraint into the form of a default stress function, then uses the stochastic gradient descent optimization algorithm to calculate the gradient of the stress function with respect to the node position, and finally moves the node position according to the calculated gradient.

[0052] 2) User-defined soft constraints: The system first converts the user-defined high-order constraints into basic constraints, converts the soft constraints in the basic constraints into the form of objective functions, uses the stochastic gradient descent optimization algorithm to calculate the gradient of the objective function with respect to the node position, and finally moves the node position according to the calculated gradient.

[0053] 3) User-defined hard constraints: The system first converts the user-defined high-order constraints into basic constraints, and converts the hard constraints in the basic constraints into the form of projection functions. The gradient projection optimization algorithm is used. If the node position satisfies the hard constraints, the node position will not be moved; if the node position does not satisfy the hard constraints, the node will be moved so that it satisfies the hard constraints, and the direction of the node movement can make the distance of this movement the shortest.

[0054] When calculating the graph layout results, each iteration traverses all defined constraints, including constraints based on node distances in graph theory and user-defined constraints. For each constraint, if it is a soft constraint, the stochastic gradient descent optimization algorithm is used; if it is a hard constraint, the gradient projection algorithm is used. After multiple iterations, the graph layout visualization result that meets the user's expectations is obtained.

[0055] Result display module: used to display the scope of each constraint and the graph layout visualization results in the graph layout view.

[0056] refer to Figure 2 As shown, the right side of the system is the visualization result of the graph layout of the data. Users can select the nodes to which constraints need to be applied by clicking or swiping nodes according to their own needs. The system will highlight the nodes that the user has selected. After completing the node selection, the user can select the type of constraint to be applied in the setting bar on the left, and customize the constraint by dragging the mouse to adjust the position of the selected node. After completing the constraint definition, the user can choose to apply the defined constraints to the graph layout and adjust the strength of the constraints. The graph layout result on the right side of the system will be adjusted according to the imposed constraints to obtain the graph layout result that meets the user's expectations, and the user-defined constraints and satisfaction are displayed in a highlighted form.

[0057] Figure 4 and Figure 5 The constraint effect of the system of the present invention is illustrated. Figure 4 is the graph layout without constraints, Figure 5 is the graph layout after constraints are imposed. Figure 5 In the figure, label 1 represents the user-defined position constraint, four arrows are used to represent the user's desired node position, and the dotted line connecting the node and the triangle represents the distance between the actual node position and the desired position; labels 2 and 3 represent the user-defined soft distance constraint and hard distance constraint, and the circle represents the position of the two nodes under the user's desired node distance. Figure 4 In the example, the two edges to which the constraint is imposed are of similar length. Figure 5 In the figure, after applying different distance constraints, the lengths of the two edges are close to the user-defined distance between the nodes. Label 4 represents the user-defined direction constraint. The angle formed by the two solid lines represents the expected angle between the line between the two nodes and the horizontal direction. Figure 4 , Figure 5 The angle between the line connecting the two nodes and the horizontal direction increases, which meets the needs of users. Label 5 represents the clustering constraint defined by the user. The user expects the distance between the selected nodes to be closer. Figure 5 Compared with the selected node Figure 4Label 6 represents the subgraph constraints defined by the user. The user can select and drag nodes to build the subgraph structure they want, and get the following: Figure 5 As shown in Figure 4 The original subgraph structure is completely different from the original one.

[0058] Figure 6 A general interactive constraint graph layout method flow chart provided in an embodiment of the present invention is shown, and the method comprises the following steps:

[0059] S1. Importing original graph data, the user selects sub-graph data that needs to be optimized from the original graph data.

[0060] S2. The user customizes the constraint type and constraint parameters for the nodes in the subgraph data according to actual needs.

[0061] Users can define the nodes to be constrained and the constraint types and parameters by clicking, brushing, moving nodes, dragging bars, entering text, etc. Figure 3 The expression diagram of basic constraints and some high-order constraints is shown. Basic constraints include position constraints, distance constraints, direction constraints and angle constraints. Position constraints are defined on a single node, which means that the position of the node is constrained to be within a certain custom range. Distance constraints and direction constraints are defined between two nodes, which means that the distance between the two nodes and the direction of the connection between the two nodes must be within a certain custom range. Angle constraints are defined between three nodes, which means that the angle formed by the three nodes must be within a certain custom range.

[0062] The high-order constraints include high-order constraints based on position constraints, high-order constraints based on distance constraints, high-order constraints based on direction constraints, and high-order constraints based on angle constraints.

[0063] High-order constraints based on location constraints include clustering constraints, circular constraints, etc. Clustering constraints mean that nodes belonging to the same class should be as close to their centers as possible; circular constraints mean that some nodes have the same position to a center, which can be converted into location constraints.

[0064] High-order constraints based on distance constraints include subgraph constraints, average edge length constraints, node overlap constraints, etc. The subgraph constraint means that the distance between each node in the subgraph should be as close as possible to the distance given by the user; the average edge length constraint means that the lengths of the edges in the graph are as equal as possible; the node overlap constraint means that the nodes should not overlap with each other as much as possible. They can be converted into distance constraints.

[0065] High-order constraints based on directional constraints include longitudinal or transverse constraints, subway map constraints, edge crossing constraints, etc., where longitudinal or transverse constraints mean that the directions of directed edges between nodes are downward / upward / left / right as much as possible; subway map constraints mean that the directions of edges are vertical or horizontal as much as possible or at a 45-degree angle to them; edge crossing constraints mean that the edges between nodes should not cross as much as possible, and they can be converted into directional constraints.

[0066] High-order constraints based on angle constraints include ring constraints, star constraints, etc. The ring constraint means that the nodes are distributed as evenly as possible on a ring; the star constraint means that the central node and the surrounding nodes are distributed in a star shape.

[0067] S3. According to the constraint type, the defined constraints are converted into different function forms, and the desired graph layout result is calculated using a suitable optimization algorithm.

[0068] Here, there are three types of constraints: constraints based on node distances in graph theory, which are constraints imposed by the system by default; the other two are user-defined soft constraints and hard constraints.

[0069] Constraints based on node distances in graph theory: The system first converts such constraints into the form of a default stress function, then uses a stochastic gradient descent optimization algorithm to calculate the gradient of the stress function with respect to the node position, and finally moves the node position according to the calculated gradient.

[0070] User-defined soft constraints: The system first converts the user-defined high-order constraints into basic constraints, converts the soft constraints in the basic constraints into the form of objective functions, uses the stochastic gradient descent optimization algorithm to calculate the gradient of the objective function with respect to the node position, and finally moves the node position according to the calculated gradient.

[0071] User-defined hard constraints: The system first converts the user-defined high-order constraints into basic constraints, and converts the hard constraints in the basic constraints into the form of projection functions. The gradient projection optimization algorithm is used. If the node position satisfies the hard constraints, the node position will not be moved; if the node position does not satisfy the hard constraints, the node will be moved so that it satisfies the hard constraints, and the direction of the node movement can make the distance of this movement the shortest.

[0072] When calculating the graph layout results, each iteration traverses all defined constraints, including constraints based on node distances in graph theory and user-defined constraints. For each constraint, if it is a soft constraint, the stochastic gradient descent optimization algorithm is used; if it is a hard constraint, the gradient projection algorithm is used. After multiple iterations, the graph layout visualization result that meets the user's expectations is obtained.

[0073] The present invention provides a general interactive constraint graph layout system and layout method, which define basic constraints and high-order constraints and use an interactive interface to accept user input, such as clicking, swiping, moving nodes, entering text, etc., to support users to easily select subgraphs, customize constraint types and adjust constraint parameters. After converting user requirements into constraint conditions, an optimization algorithm is used to calculate a graph layout visualization result that meets user expectations. At the same time, the effect of the constraints in the graph layout is displayed in a highlighted form, which facilitates users to understand whether their requirements are met.

[0074] The above embodiments are merely illustrative of the present invention, and the present invention may also be implemented in other specific ways or other specific forms without departing from the gist or essential features of the present invention. Therefore, the described embodiments should be considered illustrative rather than restrictive in any respect. The scope of the present invention should be described by the appended claims, and any changes equivalent to the intent and scope of the claims should also be included within the scope of the present invention.

Claims

1. A general interactive constraint graph layout system, characterized in that: The system includes a graph data preparation module, a constraint module, a modeling and calculation module, and a result display module, wherein: The graph data preparation module is used for the user to import original graph data and select sub-graph data that needs to be optimized from the original graph data; The constraint module is used to impose constraints on nodes in the original graph data and subgraph data. For nodes in the original graph data, the constraint module uses the default shortest path algorithm to impose constraints based on node distances in graph theory. For nodes in the subgraph data selected by the user, the user can customize the constraint type and constraint parameters. The modeling and calculation module is used to convert various types of constraints into different functional forms and use appropriate optimization algorithms to calculate the graph layout visualization results that meet the user's expectations; Result display module: used to display the scope of each constraint and the visualization result of the graph layout in the graph layout view; The constraint module includes a basic constraint submodule and a high-order constraint submodule, wherein the basic constraint submodule is used to define basic constraints, including position constraints, distance constraints, direction constraints and angle constraints; the high-order constraint submodule is used to define high-order constraints, including high-order constraints based on position constraints, high-order constraints based on distance constraints, high-order constraints based on direction constraints and high-order constraints based on angle constraints; the high-order constraints can be deconstructed into the form of basic constraints; The modeling and calculation module converts various types of constraints into different functional forms and uses a suitable optimization algorithm to calculate the graph layout visualization results that meet the user's expectations, including the following situations: The system converts the node distance constraint based on graph theory into the form of a default stress function, uses the stochastic gradient descent optimization algorithm to calculate the gradient of the stress function to the node position, and moves the node position according to the calculated gradient; The system converts the user-defined high-order constraints into basic constraints, converts the soft constraints in the basic constraints into the form of objective functions, uses the stochastic gradient descent optimization algorithm to calculate the gradient of the objective function to the node position, and moves the node position according to the calculated gradient; The system converts the user-defined high-order constraints into basic constraints, and converts the hard constraints in the basic constraints into the form of projection functions. The system uses the gradient projection optimization algorithm. If the node position satisfies the hard constraints, the node position will not be moved; if the node position does not satisfy the hard constraints, the node will be moved so that it satisfies the hard constraints, and the direction of the node movement can make the distance of this movement the shortest.

2. The general interactive constraint graph layout system according to claim 1, characterized in that: Each of the basic constraints includes two types: soft constraints and hard constraints. Soft constraints mean that the constraints can be approximately satisfied, and hard constraints mean that the constraints must be strictly satisfied. Constraints based on node distances in graph theory are only soft constraints.

3. The general interactive constraint graph layout system according to claim 1 or 2, characterized in that: When the user defines the nodes to be constrained, the constraint types and constraint parameters to be imposed, the interaction methods provided by the system include clicking, brushing, moving nodes, dragging bars and entering text.

4. A general interactive constraint graph layout method, the method comprising the following steps: S1. Importing original graph data, the user selects sub-graph data to be optimized from the original graph data; S2. The user customizes the constraint type and constraint parameters for the nodes in the subgraph data according to actual needs. The user-defined constraint types include basic constraints and high-order constraints. The basic constraints include position constraints, distance constraints, direction constraints, and angle constraints. The high-order constraints include high-order constraints based on position constraints, high-order constraints based on distance constraints, high-order constraints based on direction constraints, and high-order constraints based on angle constraints. The high-order constraints can be deconstructed into the form of basic constraints. S3. Each iteration traverses all defined constraints, and according to the constraint type, the defined constraints are converted into different function forms. After multiple iterations using a suitable optimization algorithm, the visualization result of the graph layout that meets the user's expectations is obtained, specifically: The node distance constraint based on graph theory is converted into the form of the default stress function, and the gradient of the stress function to the node position is calculated using the stochastic gradient descent optimization algorithm, and the node position is moved according to the calculated gradient; Convert the user-defined high-order constraints into basic constraints, convert the soft constraints in the basic constraints into the form of objective functions, use the stochastic gradient descent optimization algorithm to calculate the gradient of the objective function with respect to the node position, and move the node position according to the calculated gradient; The user-defined high-order constraints are converted into basic constraints, and the hard constraints in the basic constraints are converted into the form of projection functions. The gradient projection optimization algorithm is used. If the node position meets the hard constraints, the node position is not moved; if the node position does not meet the hard constraints, the node is moved so that it meets the hard constraints, and the direction of the node movement can make the distance of this movement the shortest.

5. The general interactive constraint graph layout method according to claim 4, characterized in that: Each of the basic constraints includes two types: soft constraints and hard constraints. Soft constraints mean that the constraints can be approximately satisfied, and hard constraints mean that the constraints must be strictly satisfied. Constraints based on node distances in graph theory are only soft constraints.

6. The general interactive constraint graph layout method according to claim 4 or 5, characterized in that: In step S2, the user defines the nodes to be constrained, the constraint type and constraint parameters to be imposed through interactive methods, wherein the interactive methods include clicking, brushing, moving nodes, dragging bars and inputting text.