US20190325078A1 - Graph search optimization system based on sorted property techniques - Google Patents
Graph search optimization system based on sorted property techniques Download PDFInfo
- Publication number
- US20190325078A1 US20190325078A1 US15/961,773 US201815961773A US2019325078A1 US 20190325078 A1 US20190325078 A1 US 20190325078A1 US 201815961773 A US201815961773 A US 201815961773A US 2019325078 A1 US2019325078 A1 US 2019325078A1
- Authority
- US
- United States
- Prior art keywords
- edge
- constraint
- edges
- sort
- current
- 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.)
- Abandoned
Links
Images
Classifications
-
- G06F17/30958—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/29—Graphical models, e.g. Bayesian networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/06—Arrangements for sorting, selecting, merging, or comparing data on individual record carriers
- G06F7/08—Sorting, i.e. grouping record carriers in numerical or other ordered sequence according to the classification of at least some of the information they carry
-
- G06K9/6201—
-
- G06K9/6296—
Definitions
- Data relationships are often modeled as a graph with the vertices of the graph representing entities and the edges of the graph representing relationships between the entities.
- communications data relating to communications between people can be represented by a graph that includes a vertex for each person with an edge between two vertices indicating a communication between the people represented by vertices.
- web traffic data relating to people selecting links on a web site (or individual web pages) that are to another web site can be represented by a graph that includes a vertex for each web site with an edge between vertices indicating that a person selected a link on the web site represented by one of the vertices to travel to the web site represented by the other vertex.
- a graph may include directed edges that are each from an out vertex (also referred to a source vertex) to an in vertex (also referred to as a target vertex).
- a directed edge indicates that the person represented by the out vertex sent a communication (e.g., electronic message) to the person represented by the in vertex.
- a directed edge indicates that the person visiting the web site represented by the out vertex selected a link to visit the web site represented by the in vertex.
- Such graphs may also have properties associated with elements (i.e., vertices and edges) of the graph.
- Each property has a value.
- an edge may have a sent time property indicating the time when the communication was sent, a type property indicating the type of the communication (e.g., email or vmail), a content property indicating the content of the communication, and so on.
- an edge may have a time property indicating the time when the link was selected, a web page property indicating the web page that contained the selected link, a link property specifying the link selected, a session property identifying a unique user session (e.g., a combination of a machine identifier, a browser identifier, and a session start time), and so on.
- a vertex of a graph representing either communications data or web traffic day may store properties related to the person represented by the vertex such as a name property, an employer property, a citizen property, a postal address property, a sex property, and so on.
- Graphs can be used to represent data relationships that include billions of entities (e.g., people, web pages) and many billions of relationships between entities (e.g., travel between web pages). As such, a graph that represents such data relationships can have many billions of vertices and edges.
- FIG. 1 illustrates a pattern of communications representing the example.
- the vertices 101 , 102 , 103 , and 104 represent persons A, B, C, and D, respectively, and the directed edges 111 , 112 , 113 , and 114 represent the communications between AB, AD, DC, and CB, respectively.
- Each edge has a sent property with the values of 10, 15, 45, and 65 for edges 111 , 112 , 113 , and 114 , respectively. So, to match the pattern, a group of four vertices needs to have edges in the directions shown and in addition the sent times of the edges need to satisfy the constraints 121 , 122 , and 123 .
- Constraint 121 specifies that the sent times of communications is that AB is before AD, AD is before DC, and DC is before CB.
- Constraint 122 specifies that the sent time of CB is within 60 seconds of the sent time of AB.
- Constraint 123 specifies that A is a citizen of the US and B is a citizen of the UK. C and D may be considered to have a null constraint in that any vertex will satisfy the null constraint irrespective of the values of its property.
- an edge of a path pattern without a constraint explicitly specified is considered to have a null constraint.
- every vertex of the graph needs to be checked for every vertex of the pattern. So, for a given vertex X in a graph, the graph needs to be checked in the positions of vertices A, B, C, and D.
- a graph can many hundreds of millions of vertices and each vertex can have thousands of incoming and outgoing edges, it can be very computationally expensive to identify all the sets of edges of a graph that match a pattern. Moreover, it may take so long to identify the matching sets of edges that the extracted information may no longer be useful.
- FIG. 1 illustrates a pattern of communications representing the example.
- FIG. 2 illustrates an example of finding a matching path using an edge-count directed system.
- FIG. 3 is a block diagram that illustrates components of the GSOS in some embodiments.
- FIG. 4 is a flow diagram that illustrates a find cycle component of the ECD system in some embodiments.
- FIG. 5 is a flow diagram that illustrates the processing of an extend path component of the ECD system in some embodiments.
- FIG. 6 is a flow diagram that illustrates the processing of a determine counts component of the ECD system in some embodiments.
- FIG. 7 is a flow diagram that illustrates the processing of an add edge to path component of the ECD system in some embodiments.
- FIG. 8 is a flow diagram that illustrates the processing of a generate constraint table component of the DC system in some embodiments.
- FIG. 9 is a flow diagram that illustrates the processing of a generate derived constraints component of the DC system in some embodiments.
- FIG. 10 is a flow diagram that illustrates the processing of a derive component of the DC system in some embodiments.
- FIG. 11 is a flow diagram that illustrates the processing of a check next condition component of the DC system in some embodiments.
- FIG. 12 is a flow diagram that illustrates the processing of a check constraints component of the DC system in some embodiments.
- FIGS. 13 and 14 are flow diagrams that illustrate the processing of an apply multi-edge constraint component of the SP system in some embodiments.
- a Graph Search Optimization System provides various techniques for reducing the computational expense when searching for patterns within a graph.
- the GSOS provides techniques that include an edge-count directed (“ECD”) system, a derived constraint (“DC”) system, and a sorted property (“SP”) system.
- ECD edge-count directed
- DC derived constraint
- SP sorted property
- the vertices of the path pattern are represented using an uppercase letter (e.g., A) and a vertex of the graph that corresponds to a vertex of the path pattern is represented using an uppercase letter with a prime (e.g., A′).
- Edges are represented by their connected vertices (e.g., (A, B)) with the first element representing the out vertex of the pair. So, the path pattern of FIG. 1 is represented as ⁇ (A, B) (C, B) (D, C) (A, D) ⁇ , and a partial matching path may be represented as ⁇ (A′, B′) (C′, B′) ⁇ .
- Properties of edges and vertices are represented by a lowercase letter (e.g., a).
- the sent time property for edge (A, B) may be represented as (A, B) ⁇ t
- a citizen property for vertex A may be represented as A ⁇ c.
- the ECD system employs edge-count directed searching that factors in the count of edges when deciding which end of a pattern to extend next.
- the ECD system finds a matching path of a graph that matches a path pattern by repeatedly extending a partial matching path in a direction (or end) based on a predecessor count of edges that are predecessors to the first edge in the partial matching path that match a constraint (e.g., edge direction) of a predecessor edge specified by the path pattern and a successor count of edges that are successors to the last edge in the partial matching path that match a constraint of a successor edge specified by the path pattern.
- a constraint e.g., edge direction
- (A, D) is the predecessor edge to (A, B)
- (C, B) is the successor edge to (A, B). So, if the partial matching path is ⁇ (A′, B′) ⁇ and the out-degree of A′ is 10, and the in-degree of B′ is 100, then the ECD system would extend the partial matching path by searching for matches to (A, D). By extending the partial matching path by predecessor edges of the first edge or successor edges of the last edge based on predecessor edge count or successor edge count, the ECD system can significantly decrease the computational resources needed to search for a path that matches a path pattern.
- FIG. 2 illustrates an example of finding a matching path using an edge-count directed system.
- the example assumes matching the path pattern of FIG. 1 without the sent time-based constraints.
- the numbers in the vertices illustrate the in-degree above the out-degree.
- Partial matching paths 211 and 212 illustrate an example of extending partial matching paths.
- the ECD system starts the search with a partial matching path of ⁇ (A′, B′) ⁇ , which matches edge (A, B) of the path pattern.
- the ECD system extends the partial matching path by matching edge (A, D) to each of the 10 out-edges (A′, D′) of vertex A′.
- the ECD system extends the partial match path by matching successor edge (C, B) to each of the 1000 in-edges (C′, B′) of vertex B′.
- Partial matching paths 221 and 222 illustrate another example of extending partial matching paths.
- the ECD system starts the search with a partial matching path of ⁇ (A′, B′) ⁇ , which matches edge (A, B) of the path pattern. Since vertex A′ has an out-degree of 100 as candidates for matching predecessor edge (A, D) and vertex B′ has an in-degree of 1000 as candidates for matching successor edge (C, B), the ECD system extends the partial matching path by matching successor edge (C, B)) to each of the 10 in-edges (C′, B′) of vertex B′.
- the ECD system extends the partial match path by matching successor edge (C, D) to each of the 100 in-edges of (D′, C′) as vertex C′.
- the DC system inputs constraints relating to multiple elements (“multi-element constraints”) of a path pattern and derives from those constraints a derived constraint relating to only one of the elements (“a single-element constraint”).
- a constraint relating to multiple edges (“a multi-edge constraint”) may be “(A, B) ⁇ a ⁇ (B, C) ⁇ a.”
- the constraint relates to adjacent edges (A, B) and (B, C) in the path pattern.
- Another constraint relating to a single edge (“a single-edge constraint”) may be “(B, C) ⁇ a ⁇ 10”.
- the DC system may derive another single-edge constraint that is “(A, B) ⁇ a ⁇ 10” based on the algebraic principle that if x ⁇ y and y ⁇ z, then x is necessarily less than z.
- a constraint relating to multiple vertices (“a multi-vertex constraint”) may be “A.d ⁇ B ⁇ d,” and a constraint relating to a single vertex (“a single-vertex constraint”) may be “B ⁇ d ⁇ 1990” where d represents date of birth.
- the DC system may derive another single-vertex constraint that is “A.d ⁇ 1990” based on the same algebraic principle.
- the DC system determines whether the derived single-edge constraint is satisfied by that edge. For example, when an edge (A′, B′) is selected as matching (A, B) of the path pattern, the DC system determines whether the derived constraint “(A, B) ⁇ a ⁇ 10” is satisfied.” If the derived constraint is not satisfied, the DC system can exclude that edge as matching (A, B) of the path pattern.
- the DC system can result in a significant decrease in the search space and corresponding decrease in the computational resources needed to search a graph. For example, if there are 1000 next edges (B′, C′) to a current edge (A′, B′) and the current edge (A′, B′) does not satisfy a derived constraint “(A, B) ⁇ a ⁇ 10,” then the DC system can avoid checking any of those next edges, assuming the current edge is (A′, B′), and can eliminate the current edge as matching the edge (A, B) of the pattern.
- the DC system can avoid having to check a number of edges that is the total of the count of the next edges and, for each next edge, the count of its next edge.
- the DC system avoids having to search for 1,001,000 edges (i.e., 1000+(1000 ⁇ 1000)).
- derived single-elements constraints i.e., derived single-edge constraints and/or derived single-vertex constraints
- the DC system can significantly reduce the computational resources needed to search for paths that match a path pattern.
- the DC system is described primarily in the context of derived single-edge constraints even though the DC system may be used in a similar manner to employ single-vertex constraints.
- the DC system applies rules to constraints to derive the derived constraints for a property graph.
- Each rule has a condition and a derived constraint.
- a condition may be “a ⁇ b AND b ⁇ c” and the derived constraint may be “a ⁇ c.”
- the DC system may store the rules in a rules table.
- the following table is an example of a rules table:
- Rule 6 is a rule for specifying the condition of “a ⁇ b AND b ⁇ c” and the derived constraint of “a ⁇ c.”
- the DC system initializes a collection of constraints for a search of the constraints specified in the path pattern, which are referred to as initial constraints. For example, if a path pattern has the constraints of “(A, B) ⁇ m ⁇ (B, C) ⁇ n,” “(B, C) ⁇ n ⁇ (C, D) ⁇ o,” and “5>(C, D) ⁇ o ⁇ (A, B) ⁇ m,” then the initial constraints may be represented by the following constraint table:
- Constraint Table Initial constraints: 1 x ⁇ y 2 y ⁇ z 3 5 > z + ( ⁇ x) where x represents (A, B) ⁇ m, y represents (B, C) ⁇ n, and z represents (C, D) ⁇ o.
- the DC system applies the rules to the constraints in the collection to derive new derived constraints, adds the newly derived constraints to the collection, and again applies the rules to the constraints in the collection that includes the newly derived constraints to derive new constraints based on the newly derived constraints. The DC system may repeat this process until no more rules can be derived. Applying the rules of the example rules table, the DC system may derive the derived constraints as represented by the following table:
- the derived constraint “y>x,” constraint number 4 is not used to derive additional derived constraints and is just a restatement of an initial fact.
- the derived constraint “z>y,” constraint number 5 is, however, used to derive the derived constraint “5>y+( ⁇ x),” constraint number 8 , by applying rule 8 to initial constraint “5>z+( ⁇ x)” and derived constraint “z ⁇ y.”
- the DC system can apply constraint number 8 to edges (A′, B′) and (B′, C′).
- the DC system can eliminate (B′, C′) as a possible next edge in a matching pattern. Without constraint 8 , the search would need to check each next edge (C′, D′) only to find that there is no edge (C′, D′) that leads to all the initial constraints being satisfied. Thus, by generating and applying derived constraints, the DC system significantly reduces the search space.
- the SP system identifies edges of a property graph that satisfy a multi-edge constraint by sorting the edges and then advancing through the edges in sorted order.
- a multi-edge constraint is a constraint of a path pattern that is based on the value of properties of two different pattern edges. For example, the constraint “(A, B) ⁇ a>(B, C) ⁇ a” is a multi-edge constraint based on two different pattern edges.
- the SP system When the SP system is searching for a matching path in a property graph that matches a path pattern and a first set of first edges and a second set of second edges are to be checked to determine which combination pairs of a first edge and second edge match the multi-edge constraint, the SP system generates a first sort of the first set and a second sort of the second set.
- the first edges are edges (A′, B′) and the second edges are edges (B′, C′).
- the SP system may sort the sets of edges in increasing order. The SP system then alternates advancing a current first edge through the first sort until the multi-edge constraint is satisfied and then advancing a current second edge through the second sort until the multi-edge constraint is not satisfied.
- the SP system designates as satisfying the constraint each combination of the current second edge and a first edge from the current first edge to the last first edge. The SP system then switches to advancing the other current edge. The SP system continues until the end of the first sort or the second sort is reached.
- Table 1 contains example values for property “a” for first edges (A′, B′) and second edges (B′, C′) that have been sorted in increasing order:
- the property graph includes nine first edges and seven second edges. If the multi-edge constraint is “(A, B) ⁇ a>(B, C) ⁇ a,” then the SP system proceeds as follows:
- FIG. 3 is a block diagram that illustrates components of the GSOS in some embodiments.
- the GSOS 300 includes stores 311 - 314 , ECD components 321 - 324 , DC components 331 - 335 , and SP component 341 .
- a property graph store 311 stores a property graph data structure that includes vertices, edges, and values for properties of the vertices and edges.
- a path pattern store 312 stores the path pattern that includes path vertices and path edges along with constraints.
- a rules store 313 stores rules for deriving constraints.
- a constraint table store 314 stores constraint tables generated when deriving constraints.
- a find cycle component 321 is invoked to find cycles that match a path pattern.
- An extend path component 322 is invoked by the find cycle component to extend a partial matching path.
- a determine counts component 323 is invoked by the extend path component to determine the counts of predecessor and successor edges.
- An add edge to path component 324 is invoked by the extend path component to add an edge to a path.
- a generate constraint table component 331 is invoked to generate constraint tables for derived constraints based on the constraints of a path pattern.
- a generate derived constraint component 332 is invoked by the generate constraint table component to generate derived constraints.
- the derive component 333 is invoked by the generate derived constraint component to derive constraints based on a rule.
- a check next condition component 334 is invoked by the derive component to generate the next condition of the rule.
- a check constraints component 335 determines whether an edge satisfies the associate constraint of a path pattern.
- An apply multi-edge constraint component 341 is invoked to apply a multi-edge constraint using sorted properties.
- the computing systems may include a central processing unit, input devices, output devices (e.g., display devices and speakers), storage devices (e.g., memory and disk drives), network interfaces, graphics processing units, cellular radio link interfaces, global positioning system devices, and so on.
- the input devices may include keyboards, pointing devices, touch screens, gesture recognition devices (e.g., for air gestures), head and eye tracking devices, microphones for voice recognition, and so on.
- the computing systems may include desktop computers, laptops, tablets, e-readers, personal digital assistants, smartphones, gaming devices, servers, and so on.
- the computing systems may access computer-readable media that include computer-readable storage media and data transmission media.
- the computer-readable storage media are tangible storage means that do not include a transitory, propagating signal. Examples of computer-readable storage media include memory such as primary memory, cache memory, and secondary memory (e.g., DVD) and other storage. The computer-readable storage media may have recorded on them or may be encoded with computer-executable instructions or logic that implements the GSOS.
- the data transmission media are used for transmitting data via transitory, propagating signals or carrier waves (e.g., electromagnetism) via a wired or wireless connection.
- the computing systems may include a secure cryptoprocessor as part of a central processing unit for generating and securely storing keys and for encrypting and decrypting data using the keys.
- the GSOS may be described in the general context of computer-executable instructions, such as program modules and components, executed by one or more computers, processors, or other devices.
- program modules or components include routines, programs, objects, data structures, and so on that perform tasks or implement data types of the GSOS.
- the functionality of the program modules may be combined or distributed as desired in various examples.
- aspects of the GSOS may be implemented in hardware using, for example, an application-specific integrated circuit (“ASIC”) or field programmable gate array (“FPGA”).
- ASIC application-specific integrated circuit
- FPGA field programmable gate array
- FIGS. 4-7 are flow diagrams that illustrates the processing of an edge-count directed system of the GSOS in some embodiments.
- FIG. 4 is a flow diagram that illustrates a find cycle component of the ECD system in some embodiments.
- a find cycle component 400 is invoked to find a cycle within a graph that matches a cycle pattern.
- a cycle pattern is a cycle of edges that each have a specified direction.
- the cycle pattern of FIG. 1 is ⁇ (A, D) (D, C) (C, B) (A, B) ⁇ .
- This path pattern is a cycle pattern because the start edge (A, D) and the end edge (A, B) share the same vertex A.
- the component selects an anchor edge of the cycle pattern such as (A, B) and loops matching each edge (A′, B′) of the graph to the anchor edge and, assuming that they match, identifying all cycles that include (A′, B′).
- the component selects a next edge (A′, B′) of the graph to match to the anchor edge.
- decision block 402 if all the edges have already been selected, then the component completes, else the component continues at block 403 .
- the component invokes an extend path component, passing an indication of the selected edge (A′, B′) as an initial partial matching path to extend the path assuming (A′, B′).
- the component may allocate a separate thread of execution for each edge so that the extending based on multiple anchor edges may be performed in parallel. For example, the component may create 1000 threads of execution and initially schedule each thread of execution to invoke the extend path component for one of, for example, 2000 edges. When a thread of execution completes, the component may schedule that thread of execution to invoke the extend path component for another thread.
- FIG. 5 is a flow diagram that illustrates the processing of an extend path component of the ECD system in some embodiments.
- the extend path component 500 is passed an indication of a partial matching path and extends the partial matching path until a match is found or the partial matching path cannot be extended to match.
- the component sets an edge (U′, V′) to the first edge in the partial matching path.
- the component sets the edge (Y′, Z′) to the last edge in the partial matching path.
- the partial matching path is a complete matching path that matches the cycle pattern and the component continues at block 508 , else the component continues at block 504 .
- decision block 504 if vertex S′ is the same as vertex E′, then the partial matching path includes a sub-cycle and thus cannot match the cycle pattern and the component completes, else the component continues at block 505 .
- decision block 505 if the length of the partial matching path is equal to the length of the cycle pattern, then a match has not been found and the component completes, else the component continues at block 506 .
- the component invokes the determine extends sizes component to determine the count of the predecessor edges of start vertex S′ and the count of the successor edges of end vertex E′.
- the component invokes an add edge to path component to add an edge to the partial matching path and then returns.
- the component outputs the complete matching path as a match to the cycle pattern and then completes.
- FIG. 6 is a flow diagram that illustrates the processing of a determine counts component of the ECD system in some embodiments.
- the determine counts component 600 is passed an indication of the partial matching path and determines the predecessor count and the successor count.
- decision block 601 if the cycle pattern indicates that the predecessor edge to the start vertex S′ in the partial matching path is an in-edge (i.e., (R′, S′)), then the component continues at block 602 , else the component continues at block 603 .
- the component sets the predecessor count (i.e., Pcount) to the in-degree of the start vertex S′.
- the component sets the predecessor count to the out-degree of the start vertex S′ in the path.
- decision block 604 if the cycle pattern indicates that the successor edge to the end vertex E′ in the partial matching path is an out-edge, then the component continues at block 605 , else the component continues at block 606 .
- the component sets the successor count (i.e., Scount) to the out-degree of the end vertex E′ and completes.
- the component sets the successor count to the in-degree of the end vertex E′ and completes.
- FIG. 7 is a flow diagram that illustrates the processing of an add edge to path component of the ECD system in some embodiments.
- the add edge to path component 700 is invoked to add an edge to the partial matching path.
- decision block 701 if the predecessor count is less than the successor count, then the component continues at block 702 , else the component continues at block 709 .
- decision block 702 if the predecessor edge in the cycle pattern is an in-edge, then the component continues at block 703 , else component continues at block 706 .
- the component selects the next predecessor in-edge (U′, S′).
- decision block 704 if all the predecessor in-edges have already been selected, then the component completes, else the component continues at block 705 .
- the component recursively invokes the extend path component, passing the partial matching path extended by the selected predecessor in-edge, and then loops to block 703 to select the next predecessor in-edge.
- the component selects the next predecessor out-edge (S′, U′).
- decision block 707 if all the predecessor out-edges have already been selected, then the component completes, else the component continues at block 708 .
- block 708 the component recursively invokes the extend path component, passing the partial matching path extended by the selected predecessor out-edge, and loops to block 706 to select the next predecessor out-edge.
- decision block 709 if the successor edge in the cycle pattern is an out-edge, then the component continues at block 710 , else the component continues at block 713 .
- the component selects the next successor out-edge (E′, U′).
- decision block 711 if all the successor out-edges have already been selected, then the component completes, else the component continues at block 712 .
- block 712 the component recursively invokes the extend path component, passing the partial matching path extended by the selected successor out-edge, and then loops to block 710 to select the next successor out-edge.
- block 713 the component selects the next successor in-edge (U′, E′).
- decision block 714 if all the successor in-edges have already been selected, then the component completes, else the component continues at block 715 .
- the component recursively invokes the extend path component, passing the partial matching path extended by the selected successor in-edge, and then loops to block 713 to select the next successor in-edge.
- the component may also factor in a constraint based on the value of a property of the edge when deciding to extend with a predecessor edge or successor edge. For example, if the predecessor count is 1000, but only 50 predecessor edges match the constraint for that predecessor edge, and the successor count is 500 and there is no constraint on the successor edges (e.g., other than direction), then the component may decide to extend in the direction of the predecessor edges.
- the component may schedule a separate thread of execution for each invocation of the extend path component.
- the ECD system may employ different strategies for scheduling the thread of execution. For example, the ECD system may schedule a thread of execution for each anchor edge, but not for any subsequent edge. In this way, the parallelism will only be at the anchor edge level. Alternatively, the ECD system may not schedule a separate thread of execution for each anchor edge but rather may schedule threads of execution when, for example, the second or third edges are added to a partial matching path.
- the parallelism strategy can be tailored to the characteristics of the path pattern and the graph.
- the strategy may be to have parallelism for the anchor edges, but not for other edges.
- the ECD system may also schedule each thread of execution to process a group of next edges. For example, if there are 1000 next edges, the ECD system may schedule 100 threads of execution to each process a group of 10 next edges.
- FIGS. 8-12 are flow diagrams that illustrate the processing of components of the DC system of the GSOS in some embodiments.
- FIG. 8 is a flow diagram that illustrates the processing of a generate constraint table component of the DC system in some embodiments.
- the component 800 is invoked to generate derived constraints based on a collection of constraints.
- the collection of constraints of a path pattern can be designated as having the type of AND or OR. If the initial collection of constraints has a type of AND, then if one of the constraints is a compound constraint (e.g., “A>B or A ⁇ C”), then the component generates a separate or child constraint table for the compound constraint with a type of OR.
- the component also links the constraint table to the child constraint table.
- the DC system checks constraints of a constraint table, it checks the compound constraints represented by a child constraint table.
- the component allocates a constraint table and designates its type.
- the component loops selecting each constraint and adding it to the constraint table.
- the component selects the next constraint.
- decision block 803 if all the constraints have already been selected, then the component continues at block 808 , else the component continues at block 804 .
- decision block 804 if the selected constraint is a compound constraint, then the component continues at block 806 , else the component continues at block 805 .
- the component adds the constraint to the constraint table and loops to block 802 to select the next constraint.
- the component recursively invokes the generate constraint table, passing an indication of the constraint table of the compound constraint along with an indication of the type.
- the component adds a reference to the child constraint table for the compound constraint and then loops to block 802 to select the next constraint.
- the component invokes a generate derived constraints component, passing an indication of the constraint table, and generates derived constraints from the initial constraints. The component then completes.
- FIG. 9 is a flow diagram that illustrates the processing of a generate derived constraints component of the DC system in some embodiments.
- the generate derived constraints component 900 is passed an indication of a constraints table and generates the derived constraints.
- the component sets a flag to indicate that no constraints have yet been derived.
- the component selects the next constraint of the constraint table.
- decision block 903 if all the constraints have already been selected, then the component continues at block 905 , else the component continues at block 904 .
- the component invokes a derive component, passing an indication of the selected constraint to generate the derived constraints, assuming that the selected constraint satisfies the first condition of the row.
- the component then loops to block 902 to select the next constraint.
- decision block 905 if a constraint was derived as indicated by the constraint derived flag being set to true, then the component continues at block 906 , else the component completes.
- block 906 the component resets to start selecting constraints at the beginning of the constraint table and loops to block 901 to again process the constraints, factoring in the newly derived constraints.
- FIG. 10 is a flow diagram that illustrates the processing of a derive component of the DC system in some embodiments.
- the derive component 1000 is passed an indication of a constraint and attempts to derive additional constraints, assuming that the constraint matches the first condition of a rule.
- the component selects the next rule with a first condition that matches the constraint.
- decision block 1002 if all the rules have already been selected, then the component completes, else the component continues at block 1003 .
- the component initializes a mapping of properties of the constraint to variables of the first condition.
- the component invokes a check next condition component to check the additional conditions for the selected rule and loops to block 1001 to select the next rule.
- FIG. 11 is a flow diagram that illustrates the processing of a check next condition component of the DC system in some embodiments.
- the check next condition component 1100 is invoked to check the next condition of the rule.
- decision block 1101 if the rule has more conditions, then the component continues at block 1102 , else the component continues at block 1107 .
- the component retrieves the constraints of the constraint table that match the next condition.
- block 1103 the component selects the next retrieved constraint.
- decision block 1104 if all the retrieved constraints have already been selected, then the component completes, else the component continues at block 1105 .
- the component updates the mapping of properties to variables of the rule.
- the component recursively invokes the check next condition component to check the next condition of the rule and loops to block 1103 to select the next retrieved constraint.
- the component adds the derived constraint to the constraint table.
- the component sets the constraint derived flag to true to indicate that a constraint has been derived and then completes.
- FIG. 12 is a flow diagram that illustrates the processing of a check constraints component of the DC system in some embodiments.
- the check constraints component 1200 is invoked, passing an indication of the constraint table, an edge, and a partial matching path, and determines whether adding the edge to the partial matching path would satisfy the constraints relating to that edge in the constraints table.
- the component selects the next constraint of the constraint table relating to that edge.
- decision block 1202 if all the constraints have already been selected, then the component completes, returning a value of true if the type of the constraint table is AND because all the constraints have been satisfied and false if the type of the constraint table is OR because none of the constraints have been satisfied.
- decision block 1203 if the selected constraint is a compound constraint, as indicated by a pointer in the child constraint table for the constraints of the compound constraint, then the component continues at block 1204 , else the component continues at block 1205 .
- the component recursively invokes a check constraints component, passing an indication of the child constraint table for the compound constraint, which returns an indication of whether the constraints of the compound constraint table have been satisfied.
- decision block 1205 if all the variables for the selected constraint are known, then the component continues at block 1206 , else the component loops to block 1201 to select the next constraint.
- the component evaluates the constraint based on the values of the variables.
- decision block 1207 if the constraint is satisfied, then the component continues at block 1208 , else the component continues at block 1209 .
- decision block 1208 if the constraint table has the type of AND, then the component loops to block 1201 to continue checking whether all constraints relating to the edge whose variables are known are satisfied, else the component completes, returning an indication that the constraint of the constraint table of type OR is satisfied because at least one constraint is satisfied.
- decision block 1209 if the constraint table has the type of AND, then the component completes, returning an indication that the constraint of the constraint table of type AND is not satisfied because at least one constraint is not satisfied, else the component loops to block 1201 to continue checking whether at least one constraint relating to the edge whose variables are known is satisfied.
- FIG. 13 is a flow diagram that illustrates the processing of an apply multi-edge constraint component of the SP system in some embodiments.
- the apply multi-edge constraint component 1300 is invoked to determine which combinations of a first edge from a set of first edges and a second edge from a set of second edges satisfy the multi-edge constraint.
- the component initializes a current first edge index i and a current second edge index j.
- decision block 1302 if the current first edge index is greater than the number of first edges or the current second edge index is greater than the number of second edges, then the component completes, else the component continues at block 1303 .
- the component designates as satisfying the multi-edge constraint each combination of the current second edge and a first edge from the current first edge to the end first edge.
- the component increments the second current edge index and loops to block 1302 to determine whether a termination condition is satisfied.
- the component increments the first current edge index and loops to block 1302 to determine whether a termination condition is satisfied.
- An implementation of the GSOS system may employ any combination of the embodiments.
- the processing described below may be performed by a computing device with a processor that executes computer-executable instructions stored on a computer-readable storage medium that implements the GSOS.
- a method performed by a computing device for finding a path in a graph that matches a path pattern is provided.
- the path pattern has pattern vertices and pattern edges with each pattern edge having a constraint.
- the graph has graph vertices and graph edges with each graph vertex having a count of connected edges.
- the method establishes a partial matching path of graph edges that matches a portion of the path pattern.
- a start graph edge in the partial matching path is connected to a start graph vertex, and an end graph edge in the partial matching path is connected to an end graph vertex.
- the method extends the partial matching path by performing the following.
- the method determines a predecessor count of predecessor graph edges connected to the start graph vertex that match the constraint for the next predecessor pattern edge of the path pattern.
- the method determines a successor count of successor graph edges connected to the end graph vertex that match the constraint for the next successor pattern edge of the path pattern.
- the method add to the partial matching path as a new start graph edge one of the predecessor graph edges.
- the method adds to the partial matching path as a new end graph edge one of the successor graph edges.
- the constraint is a direction of an edge.
- the establishing of a partial matching path includes initializing the partial matching path with a graph edge that matches the constraint of an anchor pattern edge.
- the method further, for each graph edge that matches the constraint of the anchor pattern edge, initializes the partial matching path with that graph edge and extending that partial matching path.
- the constraint is based on a value of a property of a graph edge. In some embodiments, the constraint is based on a value of a property of a graph vertex.
- 7 the path pattern is a cycle. In some embodiments, the graph is a directed graph and the path pattern is a directed pattern. In some embodiments, the path pattern is a directed cycle. In some embodiments, the constraint is a direction of an edge.
- the method further, when the predecessor count is less than the successor count, for each predecessor graph edge, schedule a thread of execution to extend the partial matching path with a predecessor graph edge as a new start graph edge of the partial matching path.
- the method schedules a thread of execution to extend the partial matching path with a successor graph edge as a new end graph edge of the partial matching path.
- a computing system for finding a pattern within a graph comprises one or more computer-readable storage mediums and one or more processors for executing computer-executable instructions stored in the one or more computer-readable storage mediums.
- the one or more computer-readable storage mediums store a graph that has vertices and edges, a path pattern that has vertices and edges, and computer-executable instructions for controlling the computing system.
- the instructions control the computing system to find a path of the graph that matches the path pattern by extending a partial matching path that matches a sub-path of the path pattern in a direction based on a predecessor count of edges that match a constraint of a predecessor edge specified by the path pattern and a successor count of edges that match a constraint of a successor edge specified by the path pattern.
- the graph is a directed graph and the constraint is a direction of an edge.
- the path pattern is a cycle.
- the constraint is based on a value of a property of an edge.
- the constraint is based on a value of a property of vertex.
- the computer-executable instructions further control the computing system to schedule a thread of execution for different edges that match the constraint to extend the partial matching path in the direction of the smaller of the predecessor count and the successor count.
- the path pattern has a path pattern length and the partial matching path has a partial matching path length, and the partial path is extended only while the partial matching path length is less than the path pattern length.
- a method performed by one or more computing systems for finding a path in a graph that matches a path pattern is provided.
- the path pattern has pattern vertices and pattern edges. At least some of the pattern edges have a constraint.
- the graph has graph vertices and graph edges with graph vertices having a count of connected edges.
- the method establishes a partial matching path of graph edges that matches a portion of the path pattern.
- the partial matching path has a start graph vertex and an end graph vertex.
- the method extends the partial matching path based a predecessor count of predecessor graph edges to the start graph vertex that match the constraint for the next predecessor pattern edge of the path pattern and a successor count of successor graph edges connected to the end graph vertex that match the constraint for the next successor pattern edge of the path pattern.
- the constraint is a direction of an edge.
- the establishing of a partial matching path includes initializing the partial matching path with a graph edge that matches the constraint of an anchor pattern edge.
- a method performed by one or more computing systems for identifying a path pattern within a property graph accesses a first constraint for a first pattern element of the path pattern and a second constraint for a second pattern element of the path pattern.
- the first constraint is based on a value of a first property of the first pattern element and a value of a second property of the second pattern element
- the second constraint is based on a value of the second property of the second pattern element.
- the method derives, from the first constraint and the second constraint, a derived constraint for the first pattern element that is based on a value of the first property of the first pattern element and not on a value of the second property of the second pattern element.
- the method determines whether the value of the first property of the graph element associated with the graph edge satisfies the derived constraint.
- the element is a graph edge.
- the element is a graph vertex.
- the method further accesses a rule for deriving a derived constraint. The rule specifies conditions and a derived constraint that can be derived when the conditions are satisfied.
- the method further applies the rule to derive the derived constraint.
- the method further accesses multiple rules for deriving derived constraints.
- the method further extends the partial matching path in a direction based on a predecessor count of graph edges that satisfy a derived constraint of a predecessor edge specified by the path pattern and a successor count of graph edges that satisfy a constraint of a successor edge specified by the path pattern.
- a computing system for deriving constraints for a path pattern of a property graph comprising one or more computer-readable storage mediums and one or more processors for executing the computer-executable instructions stored in the one or more computer-readable storage mediums.
- the one or more computer-readable storage mediums store rules specifying conditions and derived constraints that can be derived when the conditions are satisfied and computer-executable instructions.
- the computer-executable instructions control the computing system to access initial constraints for a target pattern element of the path pattern, the initial constraints including a next initial constraint based on a value of a property of a next pattern element adjacent to the target pattern element in the path pattern.
- the computer-executable instructions also control the computing system to apply the rules to the initial constraints to derive one or more derived constraints, including a derived constraint that is derived from a next base constraint and that is not based on a value of a property of the next pattern element.
- the element is a graph edge.
- the element is a graph vertex.
- the computer-executable instructions further include instructions to, when determining whether a graph edge corresponding to the target pattern edge of the path pattern is to be added to a partial matching path that matches a portion of the path pattern, determine whether the graph edge satisfies a derived constraint.
- the rules are applied to initial constraints and previously derived constraints. In some embodiments, the rules are transitively applied.
- a computing system for deriving constraints for a path pattern of a property graph comprises one or more computer-readable storage mediums storing computer-executable instruction and one or more processors for executing the computer-executable instructions stored in the one or more computer-readable storage mediums.
- the computer-executable instructions control the computing system to access initial constraints for a target pattern element of the path pattern.
- the initial constraints include a next initial constraint that is based on a value of a property of a next pattern element adjacent to the target pattern element in the path pattern.
- the computer-executable instructions control the computing system to generate a derived constraint from the next initial constraints, the derived constraint not being based on value of a property of the next element.
- the computer-executable instructions further control the computing system to, when determining whether a graph edge corresponding to the target pattern edge of the path pattern is to be added to a partial matching path that matches a portion of the path pattern, determine whether the element associated with the graph edge satisfies the derived constraint.
- the computer-executable instructions further control the computing system to generate derived constraints from initial constraints that are not based on a value of a next pattern element adjacent to the target pattern element in the path pattern.
- the computer-executable instructions that control the computing system to generate a derived constraint apply rules specifying conditions and derived constraints.
- a method performed by a computing system is provided to identify edges of a property graph that satisfy a multi-edge constraint that specifies a first property of a first edge, a second property of a second edge, and an order relation between the first property and the second property.
- the method accesses a first sort of first edges connected to a first vertex.
- the first sort is based on a value of the first property of the first edges.
- the method accesses a second sort of second edges connected to a second vertex.
- the second sort based on a value of the second property of the second edges.
- the method initializes a current first edge to a start first edge of the first sort and a current second edge to a start second edge of the second sort.
- the method repeat the following until a termination criterion is satisfied.
- the method advances the current first edge.
- the method designates as satisfying the multi-edge constraint each combination the current second edge and each first edge from the current first edge to an end edge and advances advancing the current second edge.
- the multi-edge constraint is that a value of a first property of a first edge is greater than a value of a second property of the second edge.
- the first sort and the second sort are in increasing order.
- the multi-edge constraint is a constraint of a path pattern.
- the edges are identified when searching for a matching path of the property graph that matches the path pattern.
- the method further generates the first sort and the second sort.
- the advancing of a current edge includes performing a binary search between the current edge and an end edge of a sort to identify the next edge in the sort that satisfies the multi-edge constraint.
- a computing system for identifying edges of a property graph that satisfy a multi-edge constraint.
- the computing system comprises one or more computer-readable storage mediums storing computer-executable and one or more processors for executing the computer-executable instructions stored in the one or more computer-readable storage mediums.
- the instructions control the computing system to traverse a first sort of first edges and a second sort of second edges in order by repeatedly performing the following.
- the instructions advance a current first edge through the first sort until the current first edge and a current second edge satisfy the multi-edge constraint.
- the instructions designate as satisfying the constraint each combination of the current second edge and a first edge from the current first edge to an end first edge at one end of the first sort.
- the instructions also advance the second current edge through the second sort until the current first edge and the current second edge do not satisfy the multi-edge constraint.
- the multi-edge constraint specifies that a value of a first property of the first edge is greater than a value of a second property of the second edge
- the first sort and the second sort are in increasing order
- the end first edge is the first edge with the largest value of the first property.
- the multi-edge constraint is a constraint of a path pattern.
- the edges are identified when searching for a matching path of the property graph that matches the path pattern.
- the computer-executable instructions further control the computing system to generate the first sort and the second sort.
- the computer-executable instructions that control the computing system to advance a current edge performs a binary search between the current edge and an end edge of a sort to identify the next edge in the sort that satisfies the multi-edge constraint.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
- Data relationships are often modeled as a graph with the vertices of the graph representing entities and the edges of the graph representing relationships between the entities. For example, communications data relating to communications between people can be represented by a graph that includes a vertex for each person with an edge between two vertices indicating a communication between the people represented by vertices. As another example, web traffic data relating to people selecting links on a web site (or individual web pages) that are to another web site can be represented by a graph that includes a vertex for each web site with an edge between vertices indicating that a person selected a link on the web site represented by one of the vertices to travel to the web site represented by the other vertex.
- To provide even more information, a graph may include directed edges that are each from an out vertex (also referred to a source vertex) to an in vertex (also referred to as a target vertex). For example, for communication data, a directed edge indicates that the person represented by the out vertex sent a communication (e.g., electronic message) to the person represented by the in vertex. As another example, for web traffic data, a directed edge indicates that the person visiting the web site represented by the out vertex selected a link to visit the web site represented by the in vertex.
- Such graphs may also have properties associated with elements (i.e., vertices and edges) of the graph. Each property has a value. For example, for communications data, an edge may have a sent time property indicating the time when the communication was sent, a type property indicating the type of the communication (e.g., email or vmail), a content property indicating the content of the communication, and so on. For web traffic data, an edge may have a time property indicating the time when the link was selected, a web page property indicating the web page that contained the selected link, a link property specifying the link selected, a session property identifying a unique user session (e.g., a combination of a machine identifier, a browser identifier, and a session start time), and so on. A vertex of a graph representing either communications data or web traffic day may store properties related to the person represented by the vertex such as a name property, an employer property, a citizen property, a postal address property, a sex property, and so on.
- Graphs can be used to represent data relationships that include billions of entities (e.g., people, web pages) and many billions of relationships between entities (e.g., travel between web pages). As such, a graph that represents such data relationships can have many billions of vertices and edges.
- Such large graphs store a wealth of valuable information, but the information can be difficult to extract. For example, someone may want to identify all communication cycles between persons A, B, C, and D in which A sent a communication to B and then to C, then C sent a communication to D, and then D sent a communication to B within 60 seconds of A sending the communication to B.
FIG. 1 illustrates a pattern of communications representing the example. Thevertices directed edges edges constraints - When searching for vertices that match a pattern, every vertex of the graph needs to be checked for every vertex of the pattern. So, for a given vertex X in a graph, the graph needs to be checked in the positions of vertices A, B, C, and D. In addition, since a graph can many hundreds of millions of vertices and each vertex can have thousands of incoming and outgoing edges, it can be very computationally expensive to identify all the sets of edges of a graph that match a pattern. Moreover, it may take so long to identify the matching sets of edges that the extracted information may no longer be useful.
-
FIG. 1 illustrates a pattern of communications representing the example. -
FIG. 2 illustrates an example of finding a matching path using an edge-count directed system. -
FIG. 3 is a block diagram that illustrates components of the GSOS in some embodiments. -
FIG. 4 is a flow diagram that illustrates a find cycle component of the ECD system in some embodiments. -
FIG. 5 is a flow diagram that illustrates the processing of an extend path component of the ECD system in some embodiments. -
FIG. 6 is a flow diagram that illustrates the processing of a determine counts component of the ECD system in some embodiments. -
FIG. 7 is a flow diagram that illustrates the processing of an add edge to path component of the ECD system in some embodiments. -
FIG. 8 is a flow diagram that illustrates the processing of a generate constraint table component of the DC system in some embodiments. -
FIG. 9 is a flow diagram that illustrates the processing of a generate derived constraints component of the DC system in some embodiments. -
FIG. 10 is a flow diagram that illustrates the processing of a derive component of the DC system in some embodiments. -
FIG. 11 is a flow diagram that illustrates the processing of a check next condition component of the DC system in some embodiments. -
FIG. 12 is a flow diagram that illustrates the processing of a check constraints component of the DC system in some embodiments. -
FIGS. 13 and 14 are flow diagrams that illustrate the processing of an apply multi-edge constraint component of the SP system in some embodiments. - Methods and systems for optimizing the searching of a graph for a portion that matches a pattern is provided. In some embodiments, a Graph Search Optimization System (“GSOS”) provides various techniques for reducing the computational expense when searching for patterns within a graph. The GSOS provides techniques that include an edge-count directed (“ECD”) system, a derived constraint (“DC”) system, and a sorted property (“SP”) system.
- The vertices of the path pattern are represented using an uppercase letter (e.g., A) and a vertex of the graph that corresponds to a vertex of the path pattern is represented using an uppercase letter with a prime (e.g., A′). Edges are represented by their connected vertices (e.g., (A, B)) with the first element representing the out vertex of the pair. So, the path pattern of
FIG. 1 is represented as {(A, B) (C, B) (D, C) (A, D)}, and a partial matching path may be represented as {(A′, B′) (C′, B′)}. Properties of edges and vertices are represented by a lowercase letter (e.g., a). Thus, the sent time property for edge (A, B) may be represented as (A, B)·t, and a citizen property for vertex A may be represented as A·c. - In some embodiments, the ECD system employs edge-count directed searching that factors in the count of edges when deciding which end of a pattern to extend next. The ECD system thus finds a matching path of a graph that matches a path pattern by repeatedly extending a partial matching path in a direction (or end) based on a predecessor count of edges that are predecessors to the first edge in the partial matching path that match a constraint (e.g., edge direction) of a predecessor edge specified by the path pattern and a successor count of edges that are successors to the last edge in the partial matching path that match a constraint of a successor edge specified by the path pattern. Referring to
FIG. 1 , (A, D) is the predecessor edge to (A, B), and (C, B) is the successor edge to (A, B). So, if the partial matching path is {(A′, B′)} and the out-degree of A′ is 10, and the in-degree of B′ is 100, then the ECD system would extend the partial matching path by searching for matches to (A, D). By extending the partial matching path by predecessor edges of the first edge or successor edges of the last edge based on predecessor edge count or successor edge count, the ECD system can significantly decrease the computational resources needed to search for a path that matches a path pattern. -
FIG. 2 illustrates an example of finding a matching path using an edge-count directed system. The example assumes matching the path pattern ofFIG. 1 without the sent time-based constraints. The numbers in the vertices illustrate the in-degree above the out-degree. Partialmatching paths -
Partial matching paths - In some embodiments, the DC system inputs constraints relating to multiple elements (“multi-element constraints”) of a path pattern and derives from those constraints a derived constraint relating to only one of the elements (“a single-element constraint”). For example, a constraint relating to multiple edges (“a multi-edge constraint”) may be “(A, B)·a<(B, C)·a.” In this example, the constraint relates to adjacent edges (A, B) and (B, C) in the path pattern. Another constraint relating to a single edge (“a single-edge constraint”) may be “(B, C)·a<10”. Given these two edge constraints, the DC system may derive another single-edge constraint that is “(A, B)·a<10” based on the algebraic principle that if x<y and y<z, then x is necessarily less than z. As another example, a constraint relating to multiple vertices (“a multi-vertex constraint”) may be “A.d<B·d,” and a constraint relating to a single vertex (“a single-vertex constraint”) may be “B·d<1990” where d represents date of birth. Given these two vertex constraints, the DC system may derive another single-vertex constraint that is “A.d<1990” based on the same algebraic principle.
- Continuing with the multi-edge constraint example, when searching, if the edge of the derived single-edge constraint is to be matched before another edge of the multi-edge constraint (e.g., the other edge is a predecessor edge or a successor edge, depending on the search direction), then the DC system determines whether the derived single-edge constraint is satisfied by that edge. For example, when an edge (A′, B′) is selected as matching (A, B) of the path pattern, the DC system determines whether the derived constraint “(A, B)·a<10” is satisfied.” If the derived constraint is not satisfied, the DC system can exclude that edge as matching (A, B) of the path pattern. The DC system can result in a significant decrease in the search space and corresponding decrease in the computational resources needed to search a graph. For example, if there are 1000 next edges (B′, C′) to a current edge (A′, B′) and the current edge (A′, B′) does not satisfy a derived constraint “(A, B)·a<10,” then the DC system can avoid checking any of those next edges, assuming the current edge is (A′, B′), and can eliminate the current edge as matching the edge (A, B) of the pattern. Moreover, if the derived constraint for a current edge (A, B) is derived from a certain value, of not the next edge (B, C), but of the edge after the next edge (C, D), then the DC system can avoid having to check a number of edges that is the total of the count of the next edges and, for each next edge, the count of its next edge. Thus, if each vertex of the graph has a degree of 1000, the DC system avoids having to search for 1,001,000 edges (i.e., 1000+(1000×1000)). By using derived single-elements constraints (i.e., derived single-edge constraints and/or derived single-vertex constraints), the DC system can significantly reduce the computational resources needed to search for paths that match a path pattern. In the following, the DC system is described primarily in the context of derived single-edge constraints even though the DC system may be used in a similar manner to employ single-vertex constraints.
- In some embodiments, the DC system applies rules to constraints to derive the derived constraints for a property graph. Each rule has a condition and a derived constraint. For example, a condition may be “a<b AND b<c” and the derived constraint may be “a<c.” The DC system may store the rules in a rules table. The following table is an example of a rules table:
-
Rules Table Rules Condition Derived Fact 1 a = b b = a 2 a = b a = c b = c 3 a = b + c b = a + (−c) c = a + (−b) 4 a < b b > a 5 a < −b b < −a 6 a < b a < c b < c 7 a > b + c b < a + (−c) c < a + (−b) 8 a > b + c a > d + c b > d - Rule 6 is a rule for specifying the condition of “a<b AND b<c” and the derived constraint of “a<c.” To derive constraints, the DC system initializes a collection of constraints for a search of the constraints specified in the path pattern, which are referred to as initial constraints. For example, if a path pattern has the constraints of “(A, B)·m<(B, C)·n,” “(B, C)·n<(C, D)·o,” and “5>(C, D)·o−(A, B)·m,” then the initial constraints may be represented by the following constraint table:
-
Constraint Table Initial constraints: 1 x < y 2 y < z 3 5 > z + (−x)
where x represents (A, B)·m, y represents (B, C)·n, and z represents (C, D)·o. After initializing the collection, the DC system applies the rules to the constraints in the collection to derive new derived constraints, adds the newly derived constraints to the collection, and again applies the rules to the constraints in the collection that includes the newly derived constraints to derive new constraints based on the newly derived constraints. The DC system may repeat this process until no more rules can be derived. Applying the rules of the example rules table, the DC system may derive the derived constraints as represented by the following table: -
Derived Constraints Matching Conditions Rule 4 y > x x < y 4 5 z > y y < z 4 6 z < 5 + (−(−x)) 5 > z + (− x) 7 (−x) < 5 + (−z) 7 x > (−5) + (−(−z)) (−x) < 5 + (−z) 5 8 5 > y + (−x) 5 > z + (−x) 8 z > y - Some of the derived constraints may not lead to reducing the search space. For example, the derived constraint “y>x,” constraint number 4, is not used to derive additional derived constraints and is just a restatement of an initial fact. The derived constraint “z>y,” constraint number 5, is, however, used to derive the derived constraint “5>y+(−x),” constraint number 8, by applying rule 8 to initial constraint “5>z+(−x)” and derived constraint “z<y.” When searching for matching paths with the initial constraints, the DC system can apply constraint number 8 to edges (A′, B′) and (B′, C′). So even if
constraint number 1 is satisfied, if constraint 8 is not satisfied, the DC system can eliminate (B′, C′) as a possible next edge in a matching pattern. Without constraint 8, the search would need to check each next edge (C′, D′) only to find that there is no edge (C′, D′) that leads to all the initial constraints being satisfied. Thus, by generating and applying derived constraints, the DC system significantly reduces the search space. - In some embodiments, the SP system identifies edges of a property graph that satisfy a multi-edge constraint by sorting the edges and then advancing through the edges in sorted order. A multi-edge constraint is a constraint of a path pattern that is based on the value of properties of two different pattern edges. For example, the constraint “(A, B)·a>(B, C)·a” is a multi-edge constraint based on two different pattern edges. When the SP system is searching for a matching path in a property graph that matches a path pattern and a first set of first edges and a second set of second edges are to be checked to determine which combination pairs of a first edge and second edge match the multi-edge constraint, the SP system generates a first sort of the first set and a second sort of the second set. Continuing with the example, the first edges are edges (A′, B′) and the second edges are edges (B′, C′). The SP system may sort the sets of edges in increasing order. The SP system then alternates advancing a current first edge through the first sort until the multi-edge constraint is satisfied and then advancing a current second edge through the second sort until the multi-edge constraint is not satisfied. Whenever a combination of a current first edge and current second edge satisfies the constraint, the SP system designates as satisfying the constraint each combination of the current second edge and a first edge from the current first edge to the last first edge. The SP system then switches to advancing the other current edge. The SP system continues until the end of the first sort or the second sort is reached.
- Table 1 contains example values for property “a” for first edges (A′, B′) and second edges (B′, C′) that have been sorted in increasing order:
-
1 2 3 4 5 6 7 8 9 (A′, B′) 1 2 5 7 9 15 20 21 22 (B′, C′) 3 4 4 10 11 12 13
In this example, the property graph includes nine first edges and seven second edges. If the multi-edge constraint is “(A, B)·a>(B, C)·a,” then the SP system proceeds as follows: -
Current Current 1st Edge 2nd Edge Matching Step (A′, B′) (B′, C′) Satisfied Combinations 1 1 1 N 2 2 1 N 3 3 1 Y (3-9, 1) 4 3 2 Y (3-9, 2) 5 3 3 Y (3-9, 3) 6 3 4 N 7 4 4 N 8 5 4 N 9 6 4 Y (6-9, 4) 10 6 5 Y (6-9, 5) 11 6 6 Y (6-9, 6) 12 6 7 Y (6-9, 7)
The SP system thus evaluates the multi-edge constraint 12 times. In comparison, if the edges were not sorted, a search would require 63 (i.e., 9×7) evaluations. The edges could also be sorted in decreasing order, and similar algorithms could be applied. -
FIG. 3 is a block diagram that illustrates components of the GSOS in some embodiments. TheGSOS 300 includes stores 311-314, ECD components 321-324, DC components 331-335, andSP component 341. Aproperty graph store 311 stores a property graph data structure that includes vertices, edges, and values for properties of the vertices and edges. Apath pattern store 312 stores the path pattern that includes path vertices and path edges along with constraints. A rules store 313 stores rules for deriving constraints. Aconstraint table store 314 stores constraint tables generated when deriving constraints. Afind cycle component 321 is invoked to find cycles that match a path pattern. An extendpath component 322 is invoked by the find cycle component to extend a partial matching path. A determine countscomponent 323 is invoked by the extend path component to determine the counts of predecessor and successor edges. An add edge topath component 324 is invoked by the extend path component to add an edge to a path. A generateconstraint table component 331 is invoked to generate constraint tables for derived constraints based on the constraints of a path pattern. A generate derivedconstraint component 332 is invoked by the generate constraint table component to generate derived constraints. The derivecomponent 333 is invoked by the generate derived constraint component to derive constraints based on a rule. A checknext condition component 334 is invoked by the derive component to generate the next condition of the rule. Acheck constraints component 335 determines whether an edge satisfies the associate constraint of a path pattern. An applymulti-edge constraint component 341 is invoked to apply a multi-edge constraint using sorted properties. - The computing systems (e.g., network nodes or collections of network nodes) on which the GSOS may be implemented may include a central processing unit, input devices, output devices (e.g., display devices and speakers), storage devices (e.g., memory and disk drives), network interfaces, graphics processing units, cellular radio link interfaces, global positioning system devices, and so on. The input devices may include keyboards, pointing devices, touch screens, gesture recognition devices (e.g., for air gestures), head and eye tracking devices, microphones for voice recognition, and so on. The computing systems may include desktop computers, laptops, tablets, e-readers, personal digital assistants, smartphones, gaming devices, servers, and so on. The computing systems may access computer-readable media that include computer-readable storage media and data transmission media. The computer-readable storage media are tangible storage means that do not include a transitory, propagating signal. Examples of computer-readable storage media include memory such as primary memory, cache memory, and secondary memory (e.g., DVD) and other storage. The computer-readable storage media may have recorded on them or may be encoded with computer-executable instructions or logic that implements the GSOS. The data transmission media are used for transmitting data via transitory, propagating signals or carrier waves (e.g., electromagnetism) via a wired or wireless connection. The computing systems may include a secure cryptoprocessor as part of a central processing unit for generating and securely storing keys and for encrypting and decrypting data using the keys.
- The GSOS may be described in the general context of computer-executable instructions, such as program modules and components, executed by one or more computers, processors, or other devices. Generally, program modules or components include routines, programs, objects, data structures, and so on that perform tasks or implement data types of the GSOS. Typically, the functionality of the program modules may be combined or distributed as desired in various examples. Aspects of the GSOS may be implemented in hardware using, for example, an application-specific integrated circuit (“ASIC”) or field programmable gate array (“FPGA”).
-
FIGS. 4-7 are flow diagrams that illustrates the processing of an edge-count directed system of the GSOS in some embodiments.FIG. 4 is a flow diagram that illustrates a find cycle component of the ECD system in some embodiments. Afind cycle component 400 is invoked to find a cycle within a graph that matches a cycle pattern. A cycle pattern is a cycle of edges that each have a specified direction. For example, the cycle pattern ofFIG. 1 is {(A, D) (D, C) (C, B) (A, B)}. This path pattern is a cycle pattern because the start edge (A, D) and the end edge (A, B) share the same vertex A. The component selects an anchor edge of the cycle pattern such as (A, B) and loops matching each edge (A′, B′) of the graph to the anchor edge and, assuming that they match, identifying all cycles that include (A′, B′). Inblock 401, the component selects a next edge (A′, B′) of the graph to match to the anchor edge. Indecision block 402, if all the edges have already been selected, then the component completes, else the component continues atblock 403. Inblock 403, the component invokes an extend path component, passing an indication of the selected edge (A′, B′) as an initial partial matching path to extend the path assuming (A′, B′). In some embodiments, the component may allocate a separate thread of execution for each edge so that the extending based on multiple anchor edges may be performed in parallel. For example, the component may create 1000 threads of execution and initially schedule each thread of execution to invoke the extend path component for one of, for example, 2000 edges. When a thread of execution completes, the component may schedule that thread of execution to invoke the extend path component for another thread. -
FIG. 5 is a flow diagram that illustrates the processing of an extend path component of the ECD system in some embodiments. The extendpath component 500 is passed an indication of a partial matching path and extends the partial matching path until a match is found or the partial matching path cannot be extended to match. Inblock 501, the component sets an edge (U′, V′) to the first edge in the partial matching path. Inblock 502, the component sets the edge (Y′, Z′) to the last edge in the partial matching path. Indecision block 503, if the start vertex S′ of the partial matching path (i.e., U′ or V′ depending on which is not the vertex shared with the next edge in the partial matching path) is the same as the end vertex E′ (i.e., Y′ or Z′ depending on which is not the vertex shared with the prior edge in the partial matching path) and the length of the partial matching path is equal to the length of the cycle pattern, then the partial matching path is a complete matching path that matches the cycle pattern and the component continues atblock 508, else the component continues atblock 504. Indecision block 504, if vertex S′ is the same as vertex E′, then the partial matching path includes a sub-cycle and thus cannot match the cycle pattern and the component completes, else the component continues atblock 505. Indecision block 505, if the length of the partial matching path is equal to the length of the cycle pattern, then a match has not been found and the component completes, else the component continues atblock 506. Inblock 506, the component invokes the determine extends sizes component to determine the count of the predecessor edges of start vertex S′ and the count of the successor edges of end vertex E′. Inblock 507, the component invokes an add edge to path component to add an edge to the partial matching path and then returns. Inblock 508, the component outputs the complete matching path as a match to the cycle pattern and then completes. -
FIG. 6 is a flow diagram that illustrates the processing of a determine counts component of the ECD system in some embodiments. The determine countscomponent 600 is passed an indication of the partial matching path and determines the predecessor count and the successor count. Indecision block 601, if the cycle pattern indicates that the predecessor edge to the start vertex S′ in the partial matching path is an in-edge (i.e., (R′, S′)), then the component continues atblock 602, else the component continues atblock 603. Inblock 602, the component sets the predecessor count (i.e., Pcount) to the in-degree of the start vertex S′. Inblock 603, the component sets the predecessor count to the out-degree of the start vertex S′ in the path. Indecision block 604, if the cycle pattern indicates that the successor edge to the end vertex E′ in the partial matching path is an out-edge, then the component continues atblock 605, else the component continues atblock 606. Inblock 605, the component sets the successor count (i.e., Scount) to the out-degree of the end vertex E′ and completes. Inblock 606, the component sets the successor count to the in-degree of the end vertex E′ and completes. -
FIG. 7 is a flow diagram that illustrates the processing of an add edge to path component of the ECD system in some embodiments. The add edge topath component 700 is invoked to add an edge to the partial matching path. Indecision block 701, if the predecessor count is less than the successor count, then the component continues atblock 702, else the component continues atblock 709. Indecision block 702, if the predecessor edge in the cycle pattern is an in-edge, then the component continues atblock 703, else component continues atblock 706. Inblock 703, the component selects the next predecessor in-edge (U′, S′). Indecision block 704, if all the predecessor in-edges have already been selected, then the component completes, else the component continues atblock 705. Inblock 705, the component recursively invokes the extend path component, passing the partial matching path extended by the selected predecessor in-edge, and then loops to block 703 to select the next predecessor in-edge. Inblock 706, the component selects the next predecessor out-edge (S′, U′). Indecision block 707, if all the predecessor out-edges have already been selected, then the component completes, else the component continues atblock 708. Inblock 708, the component recursively invokes the extend path component, passing the partial matching path extended by the selected predecessor out-edge, and loops to block 706 to select the next predecessor out-edge. Indecision block 709, if the successor edge in the cycle pattern is an out-edge, then the component continues atblock 710, else the component continues atblock 713. Inblock 710, the component selects the next successor out-edge (E′, U′). Indecision block 711, if all the successor out-edges have already been selected, then the component completes, else the component continues atblock 712. Inblock 712, the component recursively invokes the extend path component, passing the partial matching path extended by the selected successor out-edge, and then loops to block 710 to select the next successor out-edge. Inblock 713, the component selects the next successor in-edge (U′, E′). Indecision block 714, if all the successor in-edges have already been selected, then the component completes, else the component continues atblock 715. Inblock 715, the component recursively invokes the extend path component, passing the partial matching path extended by the selected successor in-edge, and then loops to block 713 to select the next successor in-edge. The component may also factor in a constraint based on the value of a property of the edge when deciding to extend with a predecessor edge or successor edge. For example, if the predecessor count is 1000, but only 50 predecessor edges match the constraint for that predecessor edge, and the successor count is 500 and there is no constraint on the successor edges (e.g., other than direction), then the component may decide to extend in the direction of the predecessor edges. - In some embodiments, the component may schedule a separate thread of execution for each invocation of the extend path component. In general, the ECD system may employ different strategies for scheduling the thread of execution. For example, the ECD system may schedule a thread of execution for each anchor edge, but not for any subsequent edge. In this way, the parallelism will only be at the anchor edge level. Alternatively, the ECD system may not schedule a separate thread of execution for each anchor edge but rather may schedule threads of execution when, for example, the second or third edges are added to a partial matching path. The parallelism strategy can be tailored to the characteristics of the path pattern and the graph. For example, if a graph has 1,000,000,000 edges with an average in-degree and out-degree of only 10 and the path pattern has four edges, then the strategy may be to have parallelism for the anchor edges, but not for other edges. The ECD system may also schedule each thread of execution to process a group of next edges. For example, if there are 1000 next edges, the ECD system may schedule 100 threads of execution to each process a group of 10 next edges.
-
FIGS. 8-12 are flow diagrams that illustrate the processing of components of the DC system of the GSOS in some embodiments.FIG. 8 is a flow diagram that illustrates the processing of a generate constraint table component of the DC system in some embodiments. Thecomponent 800 is invoked to generate derived constraints based on a collection of constraints. The collection of constraints of a path pattern can be designated as having the type of AND or OR. If the initial collection of constraints has a type of AND, then if one of the constraints is a compound constraint (e.g., “A>B or A<C”), then the component generates a separate or child constraint table for the compound constraint with a type of OR. The component also links the constraint table to the child constraint table. When the DC system checks constraints of a constraint table, it checks the compound constraints represented by a child constraint table. Inblock 801, the component allocates a constraint table and designates its type. In blocks 802-807, the component loops selecting each constraint and adding it to the constraint table. Inblock 802, the component selects the next constraint. Indecision block 803, if all the constraints have already been selected, then the component continues atblock 808, else the component continues atblock 804. Indecision block 804, if the selected constraint is a compound constraint, then the component continues atblock 806, else the component continues atblock 805. Inblock 805, the component adds the constraint to the constraint table and loops to block 802 to select the next constraint. Inblock 806, the component recursively invokes the generate constraint table, passing an indication of the constraint table of the compound constraint along with an indication of the type. Inblock 807, the component adds a reference to the child constraint table for the compound constraint and then loops to block 802 to select the next constraint. Inblock 808, the component invokes a generate derived constraints component, passing an indication of the constraint table, and generates derived constraints from the initial constraints. The component then completes. -
FIG. 9 is a flow diagram that illustrates the processing of a generate derived constraints component of the DC system in some embodiments. The generate derivedconstraints component 900 is passed an indication of a constraints table and generates the derived constraints. Inblock 901, the component sets a flag to indicate that no constraints have yet been derived. Inblock 902, the component selects the next constraint of the constraint table. Indecision block 903, if all the constraints have already been selected, then the component continues atblock 905, else the component continues atblock 904. Inblock 904, the component invokes a derive component, passing an indication of the selected constraint to generate the derived constraints, assuming that the selected constraint satisfies the first condition of the row. The component then loops to block 902 to select the next constraint. Indecision block 905, if a constraint was derived as indicated by the constraint derived flag being set to true, then the component continues atblock 906, else the component completes. Inblock 906, the component resets to start selecting constraints at the beginning of the constraint table and loops to block 901 to again process the constraints, factoring in the newly derived constraints. -
FIG. 10 is a flow diagram that illustrates the processing of a derive component of the DC system in some embodiments. The derivecomponent 1000 is passed an indication of a constraint and attempts to derive additional constraints, assuming that the constraint matches the first condition of a rule. Inblock 1001, the component selects the next rule with a first condition that matches the constraint. Indecision block 1002, if all the rules have already been selected, then the component completes, else the component continues atblock 1003. Inblock 1003, the component initializes a mapping of properties of the constraint to variables of the first condition. Inblock 1004, the component invokes a check next condition component to check the additional conditions for the selected rule and loops to block 1001 to select the next rule. -
FIG. 11 is a flow diagram that illustrates the processing of a check next condition component of the DC system in some embodiments. The checknext condition component 1100 is invoked to check the next condition of the rule. Indecision block 1101, if the rule has more conditions, then the component continues atblock 1102, else the component continues atblock 1107. Inblock 1102, the component retrieves the constraints of the constraint table that match the next condition. Inblock 1103, the component selects the next retrieved constraint. Indecision block 1104, if all the retrieved constraints have already been selected, then the component completes, else the component continues atblock 1105. Inblock 1105, the component updates the mapping of properties to variables of the rule. Inblock 1106, the component recursively invokes the check next condition component to check the next condition of the rule and loops to block 1103 to select the next retrieved constraint. Inblock 1107, the component adds the derived constraint to the constraint table. Inblock 1108, the component sets the constraint derived flag to true to indicate that a constraint has been derived and then completes. -
FIG. 12 is a flow diagram that illustrates the processing of a check constraints component of the DC system in some embodiments. Thecheck constraints component 1200 is invoked, passing an indication of the constraint table, an edge, and a partial matching path, and determines whether adding the edge to the partial matching path would satisfy the constraints relating to that edge in the constraints table. Inblock 1201, the component selects the next constraint of the constraint table relating to that edge. Indecision block 1202, if all the constraints have already been selected, then the component completes, returning a value of true if the type of the constraint table is AND because all the constraints have been satisfied and false if the type of the constraint table is OR because none of the constraints have been satisfied. Indecision block 1203, if the selected constraint is a compound constraint, as indicated by a pointer in the child constraint table for the constraints of the compound constraint, then the component continues atblock 1204, else the component continues atblock 1205. Inblock 1204, the component recursively invokes a check constraints component, passing an indication of the child constraint table for the compound constraint, which returns an indication of whether the constraints of the compound constraint table have been satisfied. Indecision block 1205, if all the variables for the selected constraint are known, then the component continues atblock 1206, else the component loops to block 1201 to select the next constraint. All the variables for the constraint will not be known, for example, when the constraint depends on the value of the property of the next edge to be added to the partial matching path. Inblock 1206, the component evaluates the constraint based on the values of the variables. Indecision block 1207, if the constraint is satisfied, then the component continues atblock 1208, else the component continues atblock 1209. Indecision block 1208, if the constraint table has the type of AND, then the component loops to block 1201 to continue checking whether all constraints relating to the edge whose variables are known are satisfied, else the component completes, returning an indication that the constraint of the constraint table of type OR is satisfied because at least one constraint is satisfied. Indecision block 1209, if the constraint table has the type of AND, then the component completes, returning an indication that the constraint of the constraint table of type AND is not satisfied because at least one constraint is not satisfied, else the component loops to block 1201 to continue checking whether at least one constraint relating to the edge whose variables are known is satisfied. -
FIG. 13 is a flow diagram that illustrates the processing of an apply multi-edge constraint component of the SP system in some embodiments. The applymulti-edge constraint component 1300 is invoked to determine which combinations of a first edge from a set of first edges and a second edge from a set of second edges satisfy the multi-edge constraint. Inblock 1301, the component initializes a current first edge index i and a current second edge index j. Indecision block 1302, if the current first edge index is greater than the number of first edges or the current second edge index is greater than the number of second edges, then the component completes, else the component continues atblock 1303. Indecision block 1303, if the current first edge and the current second edge satisfy the constraint, then the component continues atblock 1304, else the component continues atblock 1306. Inblock 1304, the component designates as satisfying the multi-edge constraint each combination of the current second edge and a first edge from the current first edge to the end first edge. Inblock 1305, the component increments the second current edge index and loops to block 1302 to determine whether a termination condition is satisfied. Inblock 1306, the component increments the first current edge index and loops to block 1302 to determine whether a termination condition is satisfied. - The following paragraphs describe various embodiments of aspects of the GSOS. An implementation of the GSOS system may employ any combination of the embodiments. The processing described below may be performed by a computing device with a processor that executes computer-executable instructions stored on a computer-readable storage medium that implements the GSOS.
- In some embodiments, a method performed by a computing device for finding a path in a graph that matches a path pattern is provided. The path pattern has pattern vertices and pattern edges with each pattern edge having a constraint. The graph has graph vertices and graph edges with each graph vertex having a count of connected edges. The method establishes a partial matching path of graph edges that matches a portion of the path pattern. A start graph edge in the partial matching path is connected to a start graph vertex, and an end graph edge in the partial matching path is connected to an end graph vertex. The method extends the partial matching path by performing the following. The method determines a predecessor count of predecessor graph edges connected to the start graph vertex that match the constraint for the next predecessor pattern edge of the path pattern. The method then determines a successor count of successor graph edges connected to the end graph vertex that match the constraint for the next successor pattern edge of the path pattern. When the predecessor count is less than the successor count, the method add to the partial matching path as a new start graph edge one of the predecessor graph edges. When the predecessor count is not less than the successor count, the method adds to the partial matching path as a new end graph edge one of the successor graph edges. In some embodiments, the constraint is a direction of an edge. In some embodiments, the establishing of a partial matching path includes initializing the partial matching path with a graph edge that matches the constraint of an anchor pattern edge. In some embodiments, the method further, for each graph edge that matches the constraint of the anchor pattern edge, initializes the partial matching path with that graph edge and extending that partial matching path. In some embodiments, the constraint is based on a value of a property of a graph edge. In some embodiments, the constraint is based on a value of a property of a graph vertex. In some embodiments, 7 the path pattern is a cycle. In some embodiments, the graph is a directed graph and the path pattern is a directed pattern. In some embodiments, the path pattern is a directed cycle. In some embodiments, the constraint is a direction of an edge. In some embodiments, the method further, when the predecessor count is less than the successor count, for each predecessor graph edge, schedule a thread of execution to extend the partial matching path with a predecessor graph edge as a new start graph edge of the partial matching path. When the predecessor count is not less than the successor count, for each successor graph edge, the method schedules a thread of execution to extend the partial matching path with a successor graph edge as a new end graph edge of the partial matching path.
- In some embodiments, a computing system for finding a pattern within a graph is provided. The computing system comprises one or more computer-readable storage mediums and one or more processors for executing computer-executable instructions stored in the one or more computer-readable storage mediums. The one or more computer-readable storage mediums store a graph that has vertices and edges, a path pattern that has vertices and edges, and computer-executable instructions for controlling the computing system. The instructions control the computing system to find a path of the graph that matches the path pattern by extending a partial matching path that matches a sub-path of the path pattern in a direction based on a predecessor count of edges that match a constraint of a predecessor edge specified by the path pattern and a successor count of edges that match a constraint of a successor edge specified by the path pattern. In some embodiments, the graph is a directed graph and the constraint is a direction of an edge. In some embodiments, the path pattern is a cycle. In some embodiments, the constraint is based on a value of a property of an edge. In some embodiments, the constraint is based on a value of a property of vertex. In some embodiments, the computer-executable instructions further control the computing system to schedule a thread of execution for different edges that match the constraint to extend the partial matching path in the direction of the smaller of the predecessor count and the successor count. In some embodiments, the path pattern has a path pattern length and the partial matching path has a partial matching path length, and the partial path is extended only while the partial matching path length is less than the path pattern length.
- In some embodiments, a method performed by one or more computing systems for finding a path in a graph that matches a path pattern is provided. The path pattern has pattern vertices and pattern edges. At least some of the pattern edges have a constraint. The graph has graph vertices and graph edges with graph vertices having a count of connected edges. The method establishes a partial matching path of graph edges that matches a portion of the path pattern. The partial matching path has a start graph vertex and an end graph vertex. The method extends the partial matching path based a predecessor count of predecessor graph edges to the start graph vertex that match the constraint for the next predecessor pattern edge of the path pattern and a successor count of successor graph edges connected to the end graph vertex that match the constraint for the next successor pattern edge of the path pattern. In some embodiments, the constraint is a direction of an edge. In some embodiments, the establishing of a partial matching path includes initializing the partial matching path with a graph edge that matches the constraint of an anchor pattern edge.
- In some embodiments, a method performed by one or more computing systems for identifying a path pattern within a property graph is provided. The method accesses a first constraint for a first pattern element of the path pattern and a second constraint for a second pattern element of the path pattern. The first constraint is based on a value of a first property of the first pattern element and a value of a second property of the second pattern element, and the second constraint is based on a value of the second property of the second pattern element. The method derives, from the first constraint and the second constraint, a derived constraint for the first pattern element that is based on a value of the first property of the first pattern element and not on a value of the second property of the second pattern element. When determining whether a graph edge of the property graph is to be added to a partial matching path of the property graph that matches a portion of the path pattern, the method determines whether the value of the first property of the graph element associated with the graph edge satisfies the derived constraint. In some embodiments, the element is a graph edge. In some embodiments, the element is a graph vertex. In some embodiments, the method further accesses a rule for deriving a derived constraint. The rule specifies conditions and a derived constraint that can be derived when the conditions are satisfied. In some embodiments, the method further applies the rule to derive the derived constraint. In some embodiments, the method further accesses multiple rules for deriving derived constraints. In some embodiments, the method further extends the partial matching path in a direction based on a predecessor count of graph edges that satisfy a derived constraint of a predecessor edge specified by the path pattern and a successor count of graph edges that satisfy a constraint of a successor edge specified by the path pattern.
- In some embodiments, a computing system for deriving constraints for a path pattern of a property graph is provided. The path pattern has elements with initial constraints. The computing system comprises one or more computer-readable storage mediums and one or more processors for executing the computer-executable instructions stored in the one or more computer-readable storage mediums. The one or more computer-readable storage mediums store rules specifying conditions and derived constraints that can be derived when the conditions are satisfied and computer-executable instructions. The computer-executable instructions control the computing system to access initial constraints for a target pattern element of the path pattern, the initial constraints including a next initial constraint based on a value of a property of a next pattern element adjacent to the target pattern element in the path pattern. The computer-executable instructions also control the computing system to apply the rules to the initial constraints to derive one or more derived constraints, including a derived constraint that is derived from a next base constraint and that is not based on a value of a property of the next pattern element. In some embodiments, the element is a graph edge. In some embodiments, the element is a graph vertex. In some embodiments, the computer-executable instructions further include instructions to, when determining whether a graph edge corresponding to the target pattern edge of the path pattern is to be added to a partial matching path that matches a portion of the path pattern, determine whether the graph edge satisfies a derived constraint. In some embodiments, the rules are applied to initial constraints and previously derived constraints. In some embodiments, the rules are transitively applied.
- In some embodiments, a computing system for deriving constraints for a path pattern of a property graph is provided. The computing system comprises one or more computer-readable storage mediums storing computer-executable instruction and one or more processors for executing the computer-executable instructions stored in the one or more computer-readable storage mediums. The computer-executable instructions control the computing system to access initial constraints for a target pattern element of the path pattern. The initial constraints include a next initial constraint that is based on a value of a property of a next pattern element adjacent to the target pattern element in the path pattern. The computer-executable instructions control the computing system to generate a derived constraint from the next initial constraints, the derived constraint not being based on value of a property of the next element. In some embodiments, the computer-executable instructions further control the computing system to, when determining whether a graph edge corresponding to the target pattern edge of the path pattern is to be added to a partial matching path that matches a portion of the path pattern, determine whether the element associated with the graph edge satisfies the derived constraint. In some embodiments, the computer-executable instructions further control the computing system to generate derived constraints from initial constraints that are not based on a value of a next pattern element adjacent to the target pattern element in the path pattern. In some embodiments, the computer-executable instructions that control the computing system to generate a derived constraint apply rules specifying conditions and derived constraints.
- In some embodiments, a method performed by a computing system is provided to identify edges of a property graph that satisfy a multi-edge constraint that specifies a first property of a first edge, a second property of a second edge, and an order relation between the first property and the second property. The method accesses a first sort of first edges connected to a first vertex. The first sort is based on a value of the first property of the first edges. The method accesses a second sort of second edges connected to a second vertex. The second sort based on a value of the second property of the second edges. The method initializes a current first edge to a start first edge of the first sort and a current second edge to a start second edge of the second sort. The method repeat the following until a termination criterion is satisfied. When the multi-edge constraint is not satisfied by the current first edge and the current second edge, the method advances the current first edge. When the multi-edge constraint is satisfied by the current first edge and the current second edge, the method designates as satisfying the multi-edge constraint each combination the current second edge and each first edge from the current first edge to an end edge and advances advancing the current second edge. In some embodiments, the multi-edge constraint is that a value of a first property of a first edge is greater than a value of a second property of the second edge. In some embodiments, the first sort and the second sort are in increasing order. In some embodiments, the multi-edge constraint is a constraint of a path pattern. In some embodiments, the edges are identified when searching for a matching path of the property graph that matches the path pattern. In some embodiments, the method further generates the first sort and the second sort. In some embodiments, the advancing of a current edge includes performing a binary search between the current edge and an end edge of a sort to identify the next edge in the sort that satisfies the multi-edge constraint.
- In some embodiments, a computing system for identifying edges of a property graph that satisfy a multi-edge constraint. The computing system comprises one or more computer-readable storage mediums storing computer-executable and one or more processors for executing the computer-executable instructions stored in the one or more computer-readable storage mediums. The instructions control the computing system to traverse a first sort of first edges and a second sort of second edges in order by repeatedly performing the following. The instructions advance a current first edge through the first sort until the current first edge and a current second edge satisfy the multi-edge constraint. The instructions designate as satisfying the constraint each combination of the current second edge and a first edge from the current first edge to an end first edge at one end of the first sort. The instructions also advance the second current edge through the second sort until the current first edge and the current second edge do not satisfy the multi-edge constraint. In some embodiments, when the multi-edge constraint specifies that a value of a first property of the first edge is greater than a value of a second property of the second edge, the first sort and the second sort are in increasing order, and the end first edge is the first edge with the largest value of the first property. In some embodiments, the multi-edge constraint is a constraint of a path pattern. In some embodiments, the edges are identified when searching for a matching path of the property graph that matches the path pattern. In some embodiments, the computer-executable instructions further control the computing system to generate the first sort and the second sort. In some embodiments, the computer-executable instructions that control the computing system to advance a current edge performs a binary search between the current edge and an end edge of a sort to identify the next edge in the sort that satisfies the multi-edge constraint.
- Although the subject matter has been described in language specific to structural features and/or acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. Accordingly, the invention is not limited except as by the appended claims.
Claims (13)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/961,773 US20190325078A1 (en) | 2018-04-24 | 2018-04-24 | Graph search optimization system based on sorted property techniques |
PCT/US2019/028393 WO2019209661A1 (en) | 2018-04-24 | 2019-04-19 | Graph search optimization system based on derived constraint techniques |
US17/341,149 US11727061B2 (en) | 2018-04-24 | 2021-06-07 | Graph search optimization system based on sorted property techniques |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/961,773 US20190325078A1 (en) | 2018-04-24 | 2018-04-24 | Graph search optimization system based on sorted property techniques |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/341,149 Continuation US11727061B2 (en) | 2018-04-24 | 2021-06-07 | Graph search optimization system based on sorted property techniques |
Publications (1)
Publication Number | Publication Date |
---|---|
US20190325078A1 true US20190325078A1 (en) | 2019-10-24 |
Family
ID=68237826
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/961,773 Abandoned US20190325078A1 (en) | 2018-04-24 | 2018-04-24 | Graph search optimization system based on sorted property techniques |
US17/341,149 Active 2038-10-30 US11727061B2 (en) | 2018-04-24 | 2021-06-07 | Graph search optimization system based on sorted property techniques |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/341,149 Active 2038-10-30 US11727061B2 (en) | 2018-04-24 | 2021-06-07 | Graph search optimization system based on sorted property techniques |
Country Status (1)
Country | Link |
---|---|
US (2) | US20190325078A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210263933A1 (en) * | 2020-02-26 | 2021-08-26 | Fujitsu Limited | Search method and search apparatus |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5651106A (en) | 1995-06-08 | 1997-07-22 | Hewlett-Packard Company | Method and apparatus for vertex sorting in a computer graphics system |
US20110289322A1 (en) | 2007-12-14 | 2011-11-24 | Rasti Mehran | Protected use of identity identifier objects |
US8490055B2 (en) | 2010-09-17 | 2013-07-16 | Ca, Inc. | Generating dependency maps from dependency data |
US9202185B2 (en) | 2011-04-08 | 2015-12-01 | Ca, Inc. | Transaction model with structural and behavioral description of complex transactions |
US9778926B2 (en) | 2014-10-30 | 2017-10-03 | Google Inc. | Minimizing image copying during partition updates |
WO2017147396A1 (en) | 2016-02-24 | 2017-08-31 | Data2Discovery | Object oriented system and method having semantic substructures for machine learning |
WO2019209661A1 (en) | 2018-04-24 | 2019-10-31 | Trovares, Inc. | Graph search optimization system based on derived constraint techniques |
-
2018
- 2018-04-24 US US15/961,773 patent/US20190325078A1/en not_active Abandoned
-
2021
- 2021-06-07 US US17/341,149 patent/US11727061B2/en active Active
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210263933A1 (en) * | 2020-02-26 | 2021-08-26 | Fujitsu Limited | Search method and search apparatus |
US11941003B2 (en) * | 2020-02-26 | 2024-03-26 | Fujitsu Limited | Search method and search apparatus for searching graph data based on search query |
Also Published As
Publication number | Publication date |
---|---|
US11727061B2 (en) | 2023-08-15 |
US20220043861A1 (en) | 2022-02-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10885116B2 (en) | Graph search optimization system based on an edge-count directed techniques | |
US20180152361A1 (en) | Distributed assignment of video analytics tasks in cloud computing environments to reduce bandwidth utilization | |
US20160092774A1 (en) | Determining and localizing anomalous network behavior | |
US10885117B2 (en) | Graph search optimization system based on derived constraint techniques | |
Sukhija et al. | Topic modeling and visualization for big data in social sciences | |
CN111475838A (en) | Graph data anonymizing method, device and storage medium based on deep neural network | |
CN109901987A (en) | A kind of method and apparatus generating test data | |
US11727061B2 (en) | Graph search optimization system based on sorted property techniques | |
US10176086B2 (en) | Event-driven software test sequence determination | |
Abawajy et al. | Hybrid consensus pruning of ensemble classifiers for big data malware detection | |
US20230252055A1 (en) | Variable density-based clustering on data streams | |
US20130346354A1 (en) | Forward inferencing of facts in parallel | |
Haque et al. | Labeling instances in evolving data streams with mapreduce | |
Qiu et al. | Cost minimization for heterogeneous systems with Gaussian distribution execution time | |
T’kindt et al. | Exponential time algorithms for just-in-time scheduling problems with common due date and symmetric weights | |
US20240143657A1 (en) | Graph data partitioning | |
WO2019209661A1 (en) | Graph search optimization system based on derived constraint techniques | |
Lin et al. | A parallel Cop-Kmeans clustering algorithm based on MapReduce framework | |
Mestre et al. | Towards the efficient parallelization of multi-pass adaptive blocking for entity matching | |
US8001122B2 (en) | Relating similar terms for information retrieval | |
Benoit et al. | Resilient scheduling of moldable parallel jobs to cope with silent errors | |
Yassir et al. | Graph-based model and algorithm for minimising big data movement in a cloud environment | |
Singh et al. | A Comparative Study of Bigdata Tools: Hadoop Vs Spark Vs Storm | |
Gimadi et al. | Efficient randomized algorithm for a vector subset problem | |
Rengaraj alias Muralidharan et al. | Gorilla Troops Optimizer Based Fault Tolerant Aware Scheduling Scheme for Cloud Environment. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: TROVARES, INC., WASHINGTON Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:HAGLIN, DAVID;CHAVARRIA-MIRANDA, DANIEL;ADOLF, ROBERT;AND OTHERS;SIGNING DATES FROM 20190328 TO 20190403;REEL/FRAME:048819/0494 |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NON FINAL ACTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: RESPONSE TO NON-FINAL OFFICE ACTION ENTERED AND FORWARDED TO EXAMINER |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: FINAL REJECTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: ADVISORY ACTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NON FINAL ACTION MAILED |
|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION |