CN109981311B - Method and device for realizing graph layout - Google Patents
Method and device for realizing graph layout Download PDFInfo
- Publication number
- CN109981311B CN109981311B CN201711445348.1A CN201711445348A CN109981311B CN 109981311 B CN109981311 B CN 109981311B CN 201711445348 A CN201711445348 A CN 201711445348A CN 109981311 B CN109981311 B CN 109981311B
- Authority
- CN
- China
- Prior art keywords
- initial
- node
- topology
- topological
- nodes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/22—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks comprising specially adapted graphical user interfaces [GUI]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Design And Manufacture Of Integrated Circuits (AREA)
Abstract
One or more embodiments of the present specification provide a method and an apparatus for implementing a graph layout, where the method may include: acquiring initial topological nodes, wherein the initial layout positions of the initial topological nodes are determined, and the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes; when a newly added topological node exists, determining an initial layout position of the newly added topological node according to the incidence relation between the newly added topological node and the initial topological node, so that a newly added relation connecting line between the newly added topological node and the initial topological node is separated from the initial relation connecting line.
Description
Technical Field
One or more embodiments of the present disclosure relate to the field of data processing technologies, and in particular, to a method and an apparatus for implementing graph layout.
Background
In the related art, based on the development of information technology visualization, a Graph (Graph) layout algorithm is used to process scattered nodes, so that the topological relation among the nodes can be presented more clearly, and the related operations such as observation and analysis can be implemented conveniently.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method and an apparatus for implementing a graph layout.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, there is provided a method for implementing a graph layout, including:
acquiring initial topological nodes, wherein the initial layout positions of the initial topological nodes are determined, and the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes;
when a newly added topological node exists, determining an initial layout position of the newly added topological node according to the incidence relation between the newly added topological node and the initial topological node, so that a newly added relation connecting line between the newly added topological node and the initial topological node is separated from the initial relation connecting line.
According to a second aspect of one or more embodiments of the present specification, there is provided a method for implementing a graph layout, including:
acquiring an initial topological node, wherein the initial layout position of the initial topological node is determined; the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes, and the initial relation connecting lines are separated from each other;
and laying out the initial topological nodes into a corresponding relational network graph through a graph layout algorithm.
According to a third aspect of one or more embodiments of the present specification, there is provided an apparatus for implementing a graph layout, including:
the device comprises an acquisition unit, a judging unit and a judging unit, wherein the acquisition unit is used for acquiring initial topological nodes, the initial layout positions of the initial topological nodes are determined, and the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes;
and the determining unit is used for determining the initial layout position of the newly added topological node according to the incidence relation between the newly added topological node and the initial topological node when the newly added topological node exists, so that the newly added relation connecting line between the newly added topological node and the initial topological node is separated from the initial relation connecting line.
According to a fourth aspect of one or more embodiments of the present specification, there is provided an apparatus for implementing a graph layout, including:
an acquisition unit that acquires an initial topology node whose initial layout position is determined; the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes, and the initial relation connecting lines are separated from each other;
and the computing unit is used for laying out the initial topological nodes into a corresponding relational network graph through a graph layout algorithm.
Drawings
Fig. 1 is a schematic diagram of an architecture of a graph layout system according to an exemplary embodiment.
FIG. 2 is a flow chart of a method for implementing a graph layout provided by an exemplary embodiment.
FIG. 3 is a flow chart of a method for implementing another diagram layout provided by an exemplary embodiment.
FIG. 4 is a schematic diagram of a partition connectivity subgraph provided in an exemplary embodiment.
Fig. 5-10 are schematic diagrams illustrating an exemplary embodiment of selecting an initial layout position for a newly added topology node.
Fig. 11 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
Fig. 12 is a block diagram of an apparatus for implementing a graph layout according to an example embodiment.
FIG. 13 is a block diagram of an apparatus for implementing another diagram layout provided by an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Fig. 1 is a schematic diagram of an architecture of a graph layout system according to an exemplary embodiment. As shown in fig. 1, the system may include a server 11, a network 12, a number of electronic devices such as a cell phone 13, a PC14, and the like.
The server 11 may be a physical server comprising an independent host, or the server 11 may be a virtual server carried by a cluster of hosts, or the server 11 may be a cloud server. During operation, the server 11 may run a server-side program of an application to implement relevant service functions of the application, such as implementing the diagram layout scheme of the present specification.
The cellular phone 13 and the PC14 are only some types of electronic devices that can be used. In fact, it is obvious that the user can also use electronic devices of the type such as: tablet devices, notebook computers, Personal Digital Assistants (PDAs), wearable devices (e.g., smart glasses, smart watches, etc.), etc., which are not limited by one or more embodiments of the present disclosure. During operation, the electronic device may run a client-side program of an application to implement a related service function of the application, such as implementing a diagram layout scheme of the present specification.
In an embodiment, the layout scheme of the present specification may be applied to the server 11 alone, or to the electronic device such as the mobile phone 13 or the PC14 alone. In another embodiment, the server 11 may run a service end with an application, and the electronic device such as the mobile phone 13 or the PC14 may run a client with an application, and the electronic device such as the mobile phone 13 or the PC14 may establish a connection with the server 11 through the network 12, so that the client and the service end may interact through the network 12, thereby implementing the diagram layout scheme of the present specification. The Network 52 may include, for example, the Public Switched Telephone Network (PSTN) and the internet.
FIG. 2 is a flow chart of a method for implementing a graph layout provided by an exemplary embodiment. As shown in fig. 2, the method may include the steps of:
In an embodiment, by performing visual mapping on the original data, a corresponding visual data node, that is, the initial topology node, may be obtained; for example, when the first original data corresponds to a first initial topology node and the second original data corresponds to a second initial topology node, a visual connection line, that is, the above-mentioned initial relationship connection line, may be formed between the corresponding first initial topology node and the second initial topology node based on the association relationship between the first original data and the second original data.
In an embodiment, each initial topology node may correspond to a single original data, or to a plurality (e.g., one or more groups) of original data, which is not limited in this specification.
In an embodiment, each initial topology node may form an initial relationship link with one or more other initial topology nodes, and the number of the initial relationship links corresponding to each initial topology node is not limited in this specification.
In an embodiment, when the newly added topology node is associated with a specific initial topology node, determining a connected node set corresponding to the specific initial topology node, where the connected node set includes the specific initial topology node and an initial topology node that directly or indirectly forms an initial relationship connection with the specific initial topology node; and determining first barycentric positions corresponding to all initial topology nodes contained in the connected node set and a second barycentric position corresponding to the specific initial topology node, wherein the initial layout position of the newly added topology node is located on an extension line of a connecting line from the first barycentric position to the second barycentric position.
In an embodiment, in addition to positioning the initial layout position of the newly added topology node on the extension line of the connection line from the first barycentric position to the second barycentric position, a set boundary corresponding to all the initial topology nodes included in the connected node set may be determined, where the initial layout position of the newly added topology node is positioned outside the set boundary. The set boundary may be determined by a Minimum outsourcing graph corresponding to all initial topology nodes included in the connected node set, for example, the Minimum outsourcing graph may include a Minimum Bounding Rectangle (MBR), a Minimum Bounding circle, and the like, which is not limited in this specification.
In an embodiment, when there is no new topology node, the initial topology node may be laid out as a corresponding relationship network graph through a graph layout algorithm.
In an embodiment, by separating the newly added relationship connection line from the initial relationship connection line, that is, by separating and not crossing the newly added relationship connection line from the initial relationship connection line, even if the initial topology node, the newly added topology node, and the like correspond to a random general data structure, when the corresponding relationship network graph is generated based on the graph layout algorithm, the probability of crossing the relationship connection line between the topology nodes in the relationship network graph can be ensured to be greatly reduced, and the structure and information of the relationship connection line between the topology nodes cannot be damaged, so that the layout effect of the relationship network graph is effectively improved, and the reading efficiency and the reading quality of a user are improved.
In one embodiment, the graph layout algorithm may include: force-directed (or called, Force-directed layout) algorithm; in other embodiments, the technical solutions in the present specification may also be applied to any other types of graph layout algorithms, which may be reduced or eliminated without being limited thereto.
FIG. 3 is a flow chart of a method for implementing another diagram layout provided by an exemplary embodiment. As shown in fig. 3, the method may include the steps of:
In an embodiment, by performing visual mapping on the original data, a corresponding visual data node, that is, the initial topology node, may be obtained; for example, when the first original data corresponds to a first initial topology node and the second original data corresponds to a second initial topology node, a visual connection line, that is, the above-mentioned initial relationship connection line, may be formed between the corresponding first initial topology node and the second initial topology node based on the association relationship between the first original data and the second original data.
In an embodiment, each initial topology node may correspond to a single original data, or to a plurality (e.g., one or more groups) of original data, which is not limited in this specification.
In an embodiment, each initial topology node may form an initial relationship link with one or more other initial topology nodes, and the number of the initial relationship links corresponding to each initial topology node is not limited in this specification.
And step 304, laying out the initial topological nodes into a corresponding relational network graph through a graph layout algorithm.
In an embodiment, by separating the new relationship connection line from the initial relationship connection line, that is, by separating and not crossing the new relationship connection line from the initial relationship connection line, even if the initial topology node corresponds to a random general data structure, when a corresponding relationship network graph is generated based on a graph layout algorithm, the probability of crossing the relationship connection line between the topology nodes in the relationship network graph can be greatly reduced, and the structure and information of the relationship connection line between the topology nodes are not damaged, so that the layout effect of the relationship network graph is effectively improved, and the reading efficiency and the reading quality of a user are improved.
In one embodiment, the graph layout algorithm may include: force-directed (or called, Force-directed layout) algorithm; in other embodiments, the technical solutions in the present specification may also be applied to any other types of graph layout algorithms, which may be reduced or eliminated without being limited thereto.
For ease of understanding, the following describes the diagram layout scheme in detail by taking several topological nodes to be laid out as examples.
FIG. 4 is a schematic diagram of a partition connectivity subgraph provided in an exemplary embodiment. In an embodiment, a user may input an initial relationship graph as shown in fig. 4 to a device, for example, the initial relationship graph may include topology node a1, topology node a2, topology node A3, topology node a4, topology node B1, … … topology node B6, and the like.
As shown in fig. 4, the topology node a1 to the topology node B6 are all visualization nodes obtained by mapping original data, and a connection line between each topology node represents an association relationship between corresponding original data; for example, when topology node a1 corresponds to raw data 1 and topology node a2 corresponds to raw data 2, if there is an association between raw data 1 and raw data 2, the association may be mapped as a connection between topology node a1 and topology node a 2.
According to the connection lines among the topological nodes, the topological nodes in the initial relationship graph can be divided into a plurality of connected subgraphs, the topological nodes in each connected subgraph are connected with each other, and the topological nodes contained in different connected subgraphs are not connected with each other, so that each connected subgraph is equivalent to an independent topological node set in the initial relationship graph. For example, as shown in fig. 4, since the topology node a1, the topology node a2, the topology node A3, and the topology node a4 are connected to each other, the topology node a1, the topology node a2, the topology node A3, and the topology node a4 form a connected subgraph 1; similarly, since the topology node B1, the topology nodes B2, … …, and the topology node B6 are connected to each other, the topology node B1, the topology nodes B2, … …, and the topology node B6 form a connected sub-graph 2; thus, the initial relationship graph shown in FIG. 4 can be divided into connected subgraph 1 and connected subgraph 2.
On the basis of the initial relationship diagram shown in fig. 4, if a new topology node (i.e., a new topology node) is continuously added and there is an association relationship between the new topology node and the topology node in the initial relationship diagram, a corresponding connection line (i.e., a new connection line) needs to be added between the new topology node and the topology node in the initial relationship diagram; accordingly, the technical solution of the present specification can ensure that no intersection exists between the newly added connection line and the initial connection line in the initial relationship diagram by selecting an appropriate initial layout position for the newly added topology node.
The following describes in detail a process of selecting an appropriate initial layout position for the newly added topology node by taking the connected subgraph 2 shown in fig. 4 as an example.
Fig. 5-10 are schematic diagrams illustrating an exemplary embodiment of selecting an initial layout position for a newly added topology node. As shown in fig. 5, a coordinate system xy is created, in which the topological nodes B1 to B6 in the connected subgraph 2 are represented, for example, the coordinates of the topological node B1 are (x1, y1), the coordinates of the topological node B2 are (x2, y2), and the coordinates of the topological node B6 are (x6, y 6).
Determining respective centroids G1(gx1, gy1) for topology node B1-6 in connected subgraph 2, wherein: gx1 ═ x1+ x2+ … + xi + … + xn)/n, gy1 ═ y1+ y2+ … + yi + … + yn)/n, and i is not less than 1 and not more than n; in the embodiment shown in fig. 5, n is 6.
Meanwhile, according to coordinates corresponding to topology nodes B1-B6 in the connected subgraph 2, a minimum enclosing rectangle MNPQ corresponding to the connected subgraph 2 can be determined, and coordinates of four vertices of the minimum enclosing rectangle MNPQ are M (xmin, ymax), N (xmax, ymax), P (xmax, ymin), Q (xmin, ymin), xmin ═ MIN [ x1, x2, …, xi, …, xn ] - α, ymin ═ MIN [ y1, y2, …, yi, …, yn ] - α, xmax ═ MAX [ x1, x2, …, xi, …, xn ] + α, ymax ═ MAX [ y1, y2, …, yi, …, yn ] + α, where α is a predefined correction parameter.
In an embodiment, there may be an association between the newly added topology node and multiple topology nodes in connected subgraph 2. For example, as shown in fig. 6, assuming that the new topology node B7 is associated with the topology node B3 and the topology node B5, the initial layout position corresponding to the new topology node B7 may be determined by:
as shown in fig. 7, for the topology node B3 and the topology node B5 associated with the newly added topology node B7 in the connected subgraph 2, a gravity center G2(gx2, gy2) between the topology node B3 and the topology node B5 is determined, where gx2 ═ (x3+ x5)/2, gy2 ═ y3+ y 5)/2. Then, a connection G2G1 formed from the center of gravity G1 to the center of gravity G2 is determined, and a point T outside the minimum envelope rectangle MNPQ (i.e., the point T is on the ray G2G1 and the point T is outside the minimum envelope rectangle MNPQ) is determined on an extension of the connection G2G1, and the point T can be used as an initial layout position of the newly added topology node B7.
As a verification, in the updated connected sub-graph 2 shown in fig. 8, it can be seen that when the newly added topology node B7 is set at the point T, all the connections formed between the topology node B1 and the topology node B7 can be surely separated from each other without generating the crossing phenomenon. Therefore, the initial layout position determined based on the scheme can ensure that reasonable initial layout is realized between the newly added topological nodes and the topological nodes in the initial relation graph, and connection lines between the topological nodes are prevented from being crossed.
In an embodiment, the newly added topology node may only be associated with a single topology node in connected subgraph 2. For example, as shown in fig. 9, assuming that the new topology node B8 is associated with the topology node B5, the initial layout position corresponding to the new topology node B8 may be determined by:
as shown in fig. 9, for the topology node B5 associated with the newly added topology node B8 in connected subgraph 2, the gravity center G3(gx3, gy3) between the topology nodes B5 is determined, where gx3 ═ x5, gy3 ═ y5 (i.e., gravity center G3 coincides with topology node B5). Then, a connection G3G1 formed from the center of gravity G1 to the center of gravity G3 is determined, and a point S outside the minimum envelope rectangle MNPQ (i.e., the point S is on the ray G3G1 and the point S is outside the minimum envelope rectangle MNPQ) is determined on an extension of the connection G3G1, and the point S can be used as an initial layout position of the newly added topology node B8.
As a verification, in the updated connected subgraph 2 shown in fig. 10, it can be seen that when the newly added topology node B8 is set at the point S, all the connections formed between the topology node B1 and the topology node B8 can be surely separated from each other without generating the crossing phenomenon. Therefore, the initial layout position determined based on the scheme can ensure that reasonable initial layout is realized between the newly added topological nodes and the topological nodes in the initial relation graph, and connection lines between the topological nodes are prevented from being crossed.
Through the method, the corresponding initial layout positions of the newly added topological nodes can be determined in sequence, so that the newly added topological nodes are gradually added into the initial relation graph to update the initial relation graph. When there is no topology node to be newly added, it may be considered that the updating processing of the initial relationship graph is completed, and a graph layout algorithm may be used to process the updated initial relationship graph, for example, a force steering algorithm may be used to process the initial relationship graph to obtain a corresponding relationship network graph.
By separating the connecting lines generated between the topological nodes in the initial relational graph and avoiding crossing, the probability of line crossing can be greatly reduced in the relational network graph obtained based on the graph layout algorithm, and the readability of the relational network graph is effectively improved. Moreover, based on the technical solution of the present specification, there is no special requirement on the data structure for the original data corresponding to the topology node in the initial relationship diagram, that is, the technical solution can be applied to a random general data structure. Meanwhile, the technical scheme based on the specification cannot damage the structure or the information of the connection line relation in the relation network graph, so that the integrity of the relation between the topological nodes is ensured.
FIG. 11 is a schematic block diagram of an electronic device in accordance with an illustrative embodiment. Referring to fig. 11, at the hardware level, the electronic device includes a processor 1102, an internal bus 1104, a network interface 1106, a memory 1108, and a non-volatile storage 1110, but may also include hardware required for other services. The processor 1102 reads a corresponding computer program from the non-volatile memory 1110 into the memory 1108 and runs the computer program, thereby forming a realization means of the graph layout on a logical level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 12, in a software implementation, the implementation means of the graph layout may include:
an obtaining unit 1201, configured to obtain an initial topology node, where an initial layout position of the initial topology node is determined, and the initial topology node forms an initial relationship connection line according to an association relationship between the initial topology node and the initial topology node;
a determining unit 1202, configured to determine, when a newly added topology node exists, an initial layout position of the newly added topology node according to an association relationship between the newly added topology node and the initial topology node, so that an added relationship connection line between the newly added topology node and the initial topology node is separated from the initial relationship connection line.
Optionally, the determining unit 1202 is specifically configured to:
when the newly added topology node is associated with a specific initial topology node, determining a connected node set corresponding to the specific initial topology node, wherein the connected node set comprises the specific initial topology node and the initial topology node which directly or indirectly forms an initial relation connection line with the specific initial topology node;
and determining first barycentric positions corresponding to all initial topology nodes contained in the connected node set and a second barycentric position corresponding to the specific initial topology node, wherein the initial layout position of the newly added topology node is located on an extension line of a connecting line from the first barycentric position to the second barycentric position.
Optionally, the determining unit 1202 is further specifically configured to:
and determining a set boundary corresponding to all initial topological nodes contained in the connected node set, wherein the initial layout position of the newly added topological node is positioned outside the set boundary.
Optionally, the set boundary is determined by a minimum outsourcing rectangle corresponding to all initial topology nodes included in the connected node set.
Optionally, the method further includes:
and the calculating unit 1203, when there is no new topology node, lays out the initial topology node into a corresponding relationship network graph through a graph layout algorithm.
Optionally, the graph layout algorithm includes: a force guidance algorithm.
Referring to fig. 13, in a software implementation, the implementation apparatus of the graph layout may include:
an obtaining unit 1301, which obtains an initial topology node, where an initial layout position of the initial topology node is determined; the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes, and the initial relation connecting lines are separated from each other;
the calculating unit 1302 lays out the initial topology nodes into a corresponding relationship network graph through a graph layout algorithm.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.
Claims (12)
1. A method for implementing graph layout is characterized by comprising the following steps:
acquiring initial topological nodes, wherein the initial layout positions of the initial topological nodes are determined, and the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes;
when a newly-added topological node exists, determining the initial layout position of the newly-added topological node according to the incidence relation between the newly-added topological node and the initial topological node so as to separate the newly-added relation connecting line between the newly-added topological node and the initial topological node from the initial relation connecting line,
determining an initial layout position of the newly added topology node according to the association relationship between the newly added topology node and the initial topology node, including:
when the newly added topology node is associated with a specific initial topology node, determining a connected node set corresponding to the specific initial topology node, wherein the connected node set comprises the specific initial topology node and the initial topology node which directly or indirectly forms an initial relation connection line with the specific initial topology node;
and determining first barycentric positions corresponding to all initial topology nodes contained in the connected node set and a second barycentric position corresponding to the specific initial topology node, wherein the initial layout position of the newly added topology node is located on an extension line of a connecting line from the first barycentric position to the second barycentric position.
2. The method according to claim 1, wherein the determining an initial layout position of the newly added topology node according to the association relationship between the newly added topology node and the initial topology node further comprises:
and determining a set boundary corresponding to all initial topological nodes contained in the connected node set, wherein the initial layout position of the newly added topological node is positioned outside the set boundary.
3. The method of claim 2, wherein the set boundary is determined by a minimum outsource rectangle corresponding to all initial topology nodes contained in the set of connected nodes.
4. The method of claim 1, further comprising:
and when no new topological node exists, the initial topological node is laid out into a corresponding relational network graph through a graph layout algorithm.
5. The method of claim 4, wherein the graph layout algorithm comprises: a force guidance algorithm.
6. A method for implementing graph layout is characterized by comprising the following steps:
acquiring an initial topological node, wherein the initial layout position of the initial topological node is determined; the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes, and the initial relation connecting lines are separated from each other;
laying out the initial topological nodes into corresponding relation network graphs through a graph layout algorithm, and when a newly added topological node is associated with a specific initial topological node in the formation of the relation network graphs, determining a connected node set corresponding to the specific initial topological node, wherein the connected node set comprises the specific initial topological node and the initial topological nodes which directly or indirectly form an initial relation connecting line with the specific initial topological node; and determining first barycentric positions corresponding to all initial topology nodes contained in the connected node set and a second barycentric position corresponding to the specific initial topology node, wherein the initial layout position of the newly added topology node is located on an extension line of a connecting line from the first barycentric position to the second barycentric position.
7. An apparatus for implementing graph layout, comprising:
the device comprises an acquisition unit, a judging unit and a judging unit, wherein the acquisition unit is used for acquiring initial topological nodes, the initial layout positions of the initial topological nodes are determined, and the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes;
a determining unit, configured to determine, when a new topology node exists, an initial layout position of the new topology node according to an association relationship between the new topology node and the initial topology node, so that an added relationship connection line between the new topology node and the initial topology node is separated from the initial relationship connection line;
the determining unit is specifically configured to:
when the newly added topology node is associated with a specific initial topology node, determining a connected node set corresponding to the specific initial topology node, wherein the connected node set comprises the specific initial topology node and the initial topology node which directly or indirectly forms an initial relation connection line with the specific initial topology node;
and determining first barycentric positions corresponding to all initial topology nodes contained in the connected node set and a second barycentric position corresponding to the specific initial topology node, wherein the initial layout position of the newly added topology node is located on an extension line of a connecting line from the first barycentric position to the second barycentric position.
8. The apparatus according to claim 7, wherein the determining unit is further configured to:
and determining a set boundary corresponding to all initial topological nodes contained in the connected node set, wherein the initial layout position of the newly added topological node is positioned outside the set boundary.
9. The apparatus of claim 8, wherein the set boundary is determined by a minimum outsource rectangle corresponding to all initial topology nodes contained in the set of connected nodes.
10. The apparatus of claim 7, further comprising:
and the computing unit is used for laying out the initial topological nodes into a corresponding relational network graph through a graph layout algorithm when no new topological nodes exist.
11. The apparatus of claim 10, wherein the graph layout algorithm comprises: a force guidance algorithm.
12. An apparatus for implementing graph layout, comprising:
an acquisition unit that acquires an initial topology node whose initial layout position is determined; the initial topological nodes form initial relation connecting lines according to the incidence relation among the initial topological nodes, and the initial relation connecting lines are separated from each other;
the computing unit is used for laying out the initial topological nodes into a corresponding relational network graph through a graph layout algorithm; when the relationship network graph is formed, when a newly added topology node is associated with a specific initial topology node, determining a connected node set corresponding to the specific initial topology node, wherein the connected node set comprises the specific initial topology node and the initial topology node which directly or indirectly forms an initial relationship connection line with the specific initial topology node; and determining first barycentric positions corresponding to all initial topology nodes contained in the connected node set and a second barycentric position corresponding to the specific initial topology node, wherein the initial layout position of the newly added topology node is located on an extension line of a connecting line from the first barycentric position to the second barycentric position.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711445348.1A CN109981311B (en) | 2017-12-27 | 2017-12-27 | Method and device for realizing graph layout |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711445348.1A CN109981311B (en) | 2017-12-27 | 2017-12-27 | Method and device for realizing graph layout |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109981311A CN109981311A (en) | 2019-07-05 |
CN109981311B true CN109981311B (en) | 2022-04-12 |
Family
ID=67072552
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711445348.1A Active CN109981311B (en) | 2017-12-27 | 2017-12-27 | Method and device for realizing graph layout |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109981311B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061921B (en) * | 2019-12-04 | 2020-10-30 | 智器云南京信息科技有限公司 | Image layout implementation method, system, terminal equipment and storage medium |
CN113342992B (en) * | 2021-06-16 | 2022-11-08 | 中国科学院空天信息创新研究院 | Knowledge map association graph layout method based on pruning technology and automatic graph expansion |
CN113704943B (en) * | 2021-09-10 | 2024-04-05 | 京东科技信息技术有限公司 | Node topological graph layout method and device, computer storage medium and electronic equipment |
CN115828488B (en) * | 2023-02-21 | 2023-05-05 | 江西中至科技有限公司 | Fresh air pipe arrangement method, system, storage medium and equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105991330A (en) * | 2015-02-13 | 2016-10-05 | 中国移动通信集团广东有限公司 | Method and apparatus for realizing circuit topology scheduling |
CN107369192A (en) * | 2017-05-31 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of annexation processing method and processing device |
CN107480409A (en) * | 2017-10-16 | 2017-12-15 | 国网四川省电力公司电力科学研究院 | A kind of powerWorld Simulator model topology hierarchical layout method |
-
2017
- 2017-12-27 CN CN201711445348.1A patent/CN109981311B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105991330A (en) * | 2015-02-13 | 2016-10-05 | 中国移动通信集团广东有限公司 | Method and apparatus for realizing circuit topology scheduling |
CN107369192A (en) * | 2017-05-31 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of annexation processing method and processing device |
CN107480409A (en) * | 2017-10-16 | 2017-12-15 | 国网四川省电力公司电力科学研究院 | A kind of powerWorld Simulator model topology hierarchical layout method |
Also Published As
Publication number | Publication date |
---|---|
CN109981311A (en) | 2019-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109981311B (en) | Method and device for realizing graph layout | |
US9928645B2 (en) | Raster-based mesh decimation | |
WO2019190625A1 (en) | Relative density-based clustering and anomaly detection system | |
JP2019511059A (en) | Method and device for outputting risk information and constructing risk information | |
US11461999B2 (en) | Image object detection method, device, electronic device and computer readable medium | |
TWI694700B (en) | Data processing method and device, user terminal | |
CN113568860B (en) | Deep learning-based multi-machine cluster topology mapping method and device and program product | |
US20190122414A1 (en) | Method and apparatus for generating virtual object | |
US11243742B2 (en) | Data merge processing based on differences between source and merged data | |
TW201513609A (en) | Network visualization systems and methods | |
TW201511504A (en) | Network management systems and methods | |
CN109416621B (en) | Utilizing computer storage systems supporting shared objects to restore free space in non-volatile storage | |
US10891319B2 (en) | Easy clustering of graphs of nodes preserving node relationships | |
US9135749B2 (en) | Method and apparatus for processing three-dimensional model data | |
US9461932B2 (en) | Visually depicting resource utilization in a cloud computing environment | |
CN116229116A (en) | Process multiplexing processing method and system based on similar parts and electronic equipment | |
TWI686704B (en) | Graph-based data processing method and system | |
CN111049988A (en) | Intimacy prediction method, system, equipment and storage medium for mobile equipment | |
CN114201271A (en) | Node determination method and device, computer equipment and storage medium | |
US9183435B2 (en) | Feature generalization using topological model | |
CN114519762A (en) | Model normal processing method and device, storage medium and electronic equipment | |
CN116127342B (en) | Information clustering processing method, system and platform based on hotel | |
US12062206B2 (en) | Methods of estimating pose graph and transformation matrix between cameras by recognizing markers on the ground in panorama images | |
CN113793346B (en) | Region attribute method and device, electronic equipment and readable storage medium | |
CN115984709B (en) | Content identification method for rapid large-scale remote sensing image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40010740 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |