CN109460493A - A kind of increment method of the time minimum spanning tree based on temporal diagram - Google Patents

A kind of increment method of the time minimum spanning tree based on temporal diagram Download PDF

Info

Publication number
CN109460493A
CN109460493A CN201811244600.7A CN201811244600A CN109460493A CN 109460493 A CN109460493 A CN 109460493A CN 201811244600 A CN201811244600 A CN 201811244600A CN 109460493 A CN109460493 A CN 109460493A
Authority
CN
China
Prior art keywords
node
time
spanning tree
minimum spanning
stack
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.)
Pending
Application number
CN201811244600.7A
Other languages
Chinese (zh)
Inventor
刘玉葆
段佳利
葛又铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CN201811244600.7A priority Critical patent/CN109460493A/en
Publication of CN109460493A publication Critical patent/CN109460493A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The increment method of the present invention relates to a kind of time minimum spanning tree based on temporal diagram, the time minimum spanning tree MSTa initial to temporal diagram are used so that scheme G change Δ G when, can renewal time minimum spanning tree rapidly.

Description

A kind of increment method of the time minimum spanning tree based on temporal diagram
Technical field
The present invention relates to tense network technique fields, generate more particularly, to a kind of time minimum based on temporal diagram The increment method of tree.
Background technique
In recent years, various catenets are increasingly by the attention of researcher.Previous, concerned by people is quiet mostly State network.It but in fact all include temporal information in many static networks, these temporal informations have network analysis particularly significant Meaning, and this network with temporal information is known as tense network.An important type is exactly society in tense network Network is handed over, wherein each edge represents the primary contact between Liang Ge group or individual.Another be usually used in research type be Transportation network, the time tag in each edge represent a certain vehicles set out and arrival time.There are also a lot of other tenses Example of network, such as cerebral nerve network, economic networks etc..
Consider an example of the travel route as temporal diagram in public traffic network.Every travel route include start site, Reach website, initial time, arrival time and cost information.It can be indicated with a digraph G=(V, E), wherein in E Each edge e can be expressed as (u, v, tu,tv, w), wherein e connection start node u and reach node v, the departure time is tu, reach Time is tv, cost w.A paths P is the sequence < e on some sides in G1,e2,…,ek>, k≤| V |, wherein side eiArrive It is side e up to nodei+1Start node.It is necessary to meet following condition for tense path in graphs, ei+1Initial time be not less than ei's This condition is known as time-constrain in field by arrival time.Time constraint condition brings challenge to research.
Minimum spanning tree problem is a classical problem in graph theory, it in reality application it is also very extensive.In society It hands in network, minimum spanning tree problem is applied to the research of information propagation, virus marketing, gossip propagation etc.;On public transport road In net, the research for the problems such as minimum spanning tree problem can be applied to path planning, optimal addressing.And under temporal diagram, it is minimum Spanning tree is also a particularly significant problem.According to the characteristic of temporal diagram, minimum spanning tree can be divided into based on time optimal Time minimum spanning tree and the cost minimum spanning tree optimal based on cost.Time optimal time most your pupil is mainly considered below Cheng Shu.
Silu Huang, Ada Wai-Chee Fu, Ruifeng Liu SIGMOD2015 paper MinimumSpann The method for solving of time minimum spanning tree in temporal diagram G is given in ingTreesinTemporalGraphs.In this way, The time minimum spanning tree of temporal diagram can be found.But, have method and become the temporal diagram for not supporting dynamic change.But existing In truth condition, temporal diagram is often dynamic change.Such as public traffic network, the feelings such as public bus network increase, deletion often occur Condition.If to search new time minimum spanning tree in temporal diagram after the change, a kind of simple method is to rerun one Secondary original lookup algorithm.However, technical staff's discovery time minimum spanning tree often only schemes the sub-fraction of G, especially exist Scheme G it is very big, and it is smaller to the change of G when it is even more obvious, this when if going to rerun former algorithm again very Unwise, this is because the side not changed much needs to detect calculating again, efficiency becomes very low.If technical staff Initial minimum spanning tree can be made full use of, and find the part impacted in temporal diagram, only to this part Minimum spanning tree can quickly be updated by being calculated.Therefore, the present invention provides the increasings of temporal diagram lower time minimum spanning tree Quantity algorithm carrys out quick renewal time minimum spanning tree.
Summary of the invention
The case where present invention changes for temporal diagram proposes a kind of increasing of time minimum spanning tree based on temporal diagram Amount method is used to original minimum spanning tree, is quickly found out new minimum spanning tree.
To realize the above goal of the invention, the technical solution adopted is that:
A kind of increment method of the time minimum spanning tree based on temporal diagram includes the case where feelings when increasing while and deleting Condition, including the following contents:
One, the case where increasing side
(1) storage organization that figure is updated according to original image G and changes delta G, keep each node go out side by the departure time from Small sequence is arrived greatly;
(2) judge whether the new side of insertion can reach node v to it and impact;If do not impacted, it is not required to Minimum spanning tree MSTa is updated, is terminated;If impacted, perform the next step;
(3) A (v) and P (v) are updated, A (v) is updated to the arrival time t of this edgev, P (v) is updated to the starting of this edge Node u;Wherein, P (v) indicates that father's node in time minimum spanning tree interior joint v, A (v) are indicated in time minimum spanning tree The earliest arrival time of midpoint v, then according to when the going out of sequential scan v of v gone out in adjacent list, if new side meets Between constrain just be added stack S in;
(4) take out stack S in a line, judge its whether can the arrival node to this edge impact;If no Impact, then continue to take the side in stack S, until its have an impact or stack S for sky;If causing influence, perform the next step;
(5) earliest arrival time and its father node of the node are updated;Then judge the node goes out side, when new side meets Between constrain, stack S is added;
(6) circulation step (4), (5) are until stack S is empty, i.e., the earliest arrival time of node does not change;At this point, the time Minimum spanning tree, which updates, to be finished;
Two, the case where deleting side
(1) storage organization that figure is first updated according to original image G and changes delta G, keep each node goes out side by the departure time Descending order;
(2) all sides in Δ G are judged, if it is the side in initial minimum spanning tree MSTa, then by the side It reaches node and set V is addeds, and will be also added in initial minimum spanning tree MSTa with these for the point in the subtree of root VsIn;
(3) to VsIn node initialized, earliest arrival time is initialized as infinity, father node is initialized as- 1, pos value is initialized as 1 (position for going out Current Scan in side of v is recorded in pos (v));
(4) side for meeting following two condition is first put into stack S: the start node of (i) this edge is not in set VsIn, Node is reached in set VsIn;(ii) this edge meets time-constrain, i.e. the departure time of this edge is greater than the side start node A value;
(5) take out stack S in a line, judge its whether can the arrival node to this edge impact;If no Impact, then continue to take the side in stack S, until its have an impact or stack S for sky;If causing influence, perform the next step;
(6) earliest arrival time and its father node, i.e. A and P value of the node are updated according to this edge, A value is updated to this The arrival time on side, P value are updated to the start node of this edge;Then judge the node goes out side, meets time-constrain then Stack S is added;
(7) circulation step (5) and (6), until stack S is sky, i.e., the earliest arrival time of node does not change;At this point, when Between minimum spanning tree update finish.
Preferably, the second part was deleted in the step of side (2), and node is added to VsIn after, to VsIn node into Row beta pruning processing:
(1) V is useddIt indicates the destination node collection on deletion side, and presses the descending arrangement of the number of plies of the node in initial MSTa;
(2)If from root node r to including V on the path of node vdIn other nodes, to VsInterior joint v It is marked with its descendant nodes;If from root node r to not including V on the path of node vdIn other nodes, execute In next step;
(3) v is marked;
(4) estimated value is indicated A ' (v) by the new earliest arrival time value for estimating v;
(5) check whether the most arrival time estimated value A ' (v) of v can impact the unlabelled child nodes of v, i.e., Judge in initial MSTa, whether v also meets time-constrain to its side of child nodes;If being unsatisfactory for time-constrain, say It is bright the child nodes to be impacted, it will be marked by the point in the subtree of root of the child nodes;If still met Between constrain, illustrate not impact child, then not marking, beta pruning can be carried out by the subtree of root of these nodes, from Vs Middle these nodes of rejecting;
(6) when successively having traversed VsIn after all nodes, VsIn to be left labeled node be exactly still impacted after beta pruning Node.
Preferably, the time minimum spanning tree MSTa is one tree T=(Vr,Er), meet the following conditions:
(1) node collection VrInclude all accessibility nodes of root node r in figure G;
(2)And v ≠ r, v only have one and enter side, r does not enter side;
(3)And v ≠ r, the path P (r, v) from r to v keep the arrival time of invocation point v earliest, node v's is earliest Arrival time is indicated with A (v).
Detailed description of the invention
The schematic diagram of Fig. 1 temporal diagram G.
The schematic diagram of the time minimum spanning tree of Fig. 2 temporal diagram G.
The schematic diagram on Fig. 3 temporal diagram G increase side.
Fig. 4 temporal diagram G increases the schematic diagram of the time minimum spanning tree behind side.
The schematic diagram on Fig. 5 temporal diagram G deletion side.
Fig. 6 temporal diagram G deletes the schematic diagram of the time minimum spanning tree behind side.
The schematic diagram of Fig. 7 temporal diagram minimum spanning tree.
Specific embodiment
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;
Below in conjunction with drawings and examples, the present invention is further elaborated.
Embodiment 1
The case where changing the present invention be directed to temporal diagram proposes a kind of time minimum spanning tree based on temporal diagram Increment method is used to original minimum spanning tree, is quickly found out new minimum spanning tree.
Related definition of the invention is provided first:
It defines 1 (temporal diagram): giving a temporal diagram G=(V, E), wherein V is the node collection of temporal diagram, and E is temporal diagram Side collection.Side e indicates with a five-tuple, i.e. e=(u, v, tu,tv, w), wherein u is the start node of side e, v It is the arrival node of side e, tuIt is the departure time of side e, tvIt is the arrival time of side e, w is the cost of this edge.The present invention claims to save Point u is a predecessor node of node v, and node v is a descendant node of node u.Meanwhile in order to be set forth below conveniently, side e Start node, reach node, departure time, arrival time, cost can also be expressed as e.u, e.v, e.tu、e.tv、 e.w。
It is temporal diagram, node collection V={ v that example 1: Fig. 1, which is one,0,v1,v2,v3,v4,v5, wherein side e=(v0,v1,2, 3,2) it is a line in figure, indicates this edge in the time 2 from node v0It sets out, reaches node v in the time 31, cost 2.It should V in figure1The side that enters be (v0,v1, 2,3,2) and (v0,v1,5,6,2);v1Go out side be (v1,v3,2,3,2)、(v1,v3,5,6,1) (v1,v4,6,7,1).So v1Predecessor node be v0, v1Descendant node be v3And v4
Define 2 (paths): the path in temporal diagram G=(V, E) refers to an edge sequence P=< e1,e2,…,ek>, ei Arrival node be ei+1Start node, and eiArrival time be not more than ei+1Departure time (1≤i≤k).The present invention recognizes For ei+1Meet time-constrain, so ability and eiA paths are constituted together.Meanwhile the present invention with P (u, v) indicate from Node u is to the path of node v.If node u to node v there are a paths, claims to be reachable from u to v.
Example 2: in temporal diagram shown in Fig. 1, P (v0,v3) indicate from node v0To node v3Path, P in this example (v0,v3)=< (v0,v1,2,3,2),(v1,v3,5,6,1)>。
Define 3 (time minimum spanning tree MSTa): in temporal diagram G, the time minimum for giving root node a r, G is generated Setting MSTa is one tree T=(Vr,Er), meet the following conditions:
(1) node collection VrInclude all accessibility nodes of root node r in figure G;
(2)And v ≠ r, v only have one and enter side, r does not enter side;
(3)And v ≠ r, the path P (r, v) from r to v keep the arrival time of invocation point v earliest, node v's is earliest Arrival time is indicated with A (v).
Example 3: for the temporal diagram in Fig. 1, giving root node is v0, it is the time minimum spanning tree of Fig. 1 shown in Fig. 2. Spanning tree interior joint v1,v2,v3,v4,v5Earliest arrival time be 3,5,6,6,8. respectively
Following definition 4 is to be specifically defined in the present invention about the increment problem of time minimum spanning tree in temporal diagram.
Definition 4: a known temporal diagram G=(V, E), root node r, and the initial time minimum spanning tree that figure G is acquired MSTa, increment problem exactly when figure G change Δ G (i.e. increase side Δ E+With deletion side Δ E-) when, find an algorithm TΔ, Affected node is found, thus quickly renewal time minimum spanning tree, and algorithm TΔIt is exactly increment proposed in the present invention Algorithm.
Subsequent explanation, the present invention continue to provide as given a definition for convenience.
It defines 5 (affected nodes): giving a temporal diagram, a root node r and initial time minimum spanning tree, root According to defining 3, each node can have a earliest arrival time (if unreachable be infinity), change Δ G when scheming G When, earliest arrival time changes in figure or the changed node of father node in tree is known as affected node.
In order to solve the problems, such as the increment of time minimum spanning tree on temporal diagram, the invention proposes following technical schemes.
Delta algorithm key proposed by the present invention is to be used to initial time minimum spanning tree MSTa, so that Figure G change Δ G when, can rapidly renewal time minimum spanning tree.SiluHuang et al. is proposed on SIGMOD2015 A kind of algorithm calculates the time minimum spanning tree on temporal diagram, and calculated minimum spanning tree is initial MSTa.Because Initial MSTa is it is known that so rightA (v) and P (v) is it is known that wherein P (v) indicates the father in initial MSTa interior joint v Node.And initial temporal diagram G is also known, and with the storage of adjacent side listings format, to any one node v, is owned Side is sorted by its departure time non-increasing out, uses Eo(v) all sides out of v are stored, | Eo(v) | it is the out-degree of node v.
The increment problem of time minimum spanning tree on temporal diagram is divided into two parts to discuss by the present invention: temporal diagram G increases Two kinds of situations while with deleting.
Part 1: the case where increasing side
This part discusses the case where temporal diagram G increases side.The present invention is first introduced for increasing a line, below The increased side in part e=(u, v, tu,tv,w)∈ΔE+It indicates, the present invention first provides lemma 1.
Lemma 1: and if only if increased side e=(u, v, tu,tv, w) in arrival time tvLess than A (v), and originate Time tu(t when more than or equal to A (u)v< A (v) and tu>=A (u)), initial time minimum spanning tree can just change.
It proves: can prove that by following four situation
(1)tv< A (v) and tu≥A(u).According to definition 2, it is known that P (r, u) ∪ e meets time-constrain, it is Yi Tiaolu Diameter.Because of the arrival time t on the side newly increasedvLess than the earliest arrival time A (v) of the initial midpoint MSTa v, thus it is increased this While e should replace in initial MSTa reach node v while.At this point, initial MSTa changes.
(2)tv>=A (v) and tu≥A(u).At this point, although P (r, u) ∪ e meets time-constrain, but because of tv> A (v), The time for illustrating that this paths reaches node v is not earliest.Therefore, initial MSTa does not change.
(3)tv< A (v) and tu<A(u).P (r, u) ∪ e is unsatisfactory for time-constrain, is not a paths, therefore not from node r Node v can be reached by P (r, u) and e.Initial MSTa does not change at this time.
(4)tv>=A (v) and tu<A(u).Initial MSTa does not change, and reason is the same as (3).
According to lemma 1, work as tv< A (v) and tu>=A (u), then e should be inserted into MSTa, instead of arriving in initial MSTa Up to the side of node v.It is likely to occur following situations at this time: using v as some before the e when increasing of start node, being unsatisfactory for the time Constraint, but after increasing side e, because the earliest arrival time A (v) of v becomes smaller, time-constrain can be met at this time.Enable VsIt indicates V is added to V if A (v) becomes smaller by affected node collectionsIn, and newly meet time-constrain and arrival for going out in side for v V is also added to corresponding arrival node in it by time smaller sidesIn, to VsIn each the node that is newly added so judge, Iteration continues, until not having new node addition, with regard to having found the affected node collection of this problem.
The step of specific renewal time minimum spanning tree is described below.
(1) storage organization that figure is first updated according to original image G and changes delta G, will keep each node to go out side by the departure time Sequence from big to small is constant.
(2) judge whether the new side of insertion can reach node v to it and impact that (i.e. the arrival earliest arrival time of v is It is not that can become smaller).If do not impacted, does not need to update MSTa, terminate;If impacted, perform the next step.
(3) A (v) and P (v) are updated, A (v) is updated to the arrival time t of this edgev, P (v) is updated to the starting of this edge Node u.Then according to when the going out of sequential scan v of v gone out in adjacent list, i.e. Eo(v) side in is (by the departure time by big To minispread), if newly meet in the just addition stack S of time-constrain (such as side < v, v ', tv,tv′, w >, meet the time about Beam indicates tv>A(v))。
(4) take out stack S in a line, judge its whether can the arrival node to this edge impact (i.e. this edge Arrival time whether than this edge reach node A value it is small).If do not impacted, continue to take the side in stack S, directly Have an impact to it or stack S is sky;If causing influence, perform the next step.
(5) earliest arrival time and its father node (i.e. A and P value) of the node are updated.Then judge the node goes out side, Newly meeting time-constrain is then added stack S.
(6) circulation step (4), (5), until stack S is sky, i.e., the earliest arrival time of node does not change.At this point, the time Minimum spanning tree, which updates, to be finished.
When in Δ G including multiple summits, time minimum spanning tree delta algorithm is only needed according to the method for increasing a line Successively judge that each side updates MSTa in Δ G, it should be noted that the present invention safeguards a variable pos (v), table What is shown is at present in Eo(v) position scanned in, such present invention would not repeat to judge to a line.
The present invention provides the pseudocode that side in delta algorithm increases part below.
It can be seen that the 1st side collection for being about to Δ G is inserted into the list of adjacent side in algorithm 1, the adjacent side list of figure is updated. 2-3 row successively judges whether each side in the Δ G changed meets time-constrain, and has smaller arrival time, such as Fruit judges that every goes out whether side impacts its descendant nodes again if being, as 4-14 row.Wherein the 11st row is sentenced Whether cut edge meets time-constrain, and the 7th row judges whether the side has smaller arrival time, if so, being then updated, it is ensured that A value only will be updated as smaller arrival time.
Theorem 1: algorithm 1 time O (| E ∪ Δ E+|) in return one update MSTa, wherein | E ∪ Δ E+| when being new The number of edges of state figure.
Prove: the present invention proves the correctness of algorithm first.As Δ E+In only a line e=(u, v, tu,tv, w) when It waits, if this edge is unsatisfactory for time-constrain or this edge meets time-constrain but tv>=A (v), then v is most at this time Early arrival time and his father node in tree will not all change, and time minimum spanning tree is constant at this time.If this edge meets Time-constrain, and tv< A (v), then will be updated the earliest arrival time A (v) and his father node P of v according to eighth row in algorithm 1 (v)。
A (v) is gone out in side to meet stackings (11-14 row) of time-constrain after becoming smaller, these sides can when popping To guarantee that its earliest arrival time only will be updated (7-8 row) becoming more hour, it equally also just can go out side to it and do to sentence It is disconnected whether stacking, can guarantee that all affected nodes are all judged in this way, also can guarantee arriving earliest for affected node Become more hour up to time optimal, tree just will be updated, and finally obtain new MSTa.
The case where for containing only a line in Δ G algorithm 1 available update MSTa.When having multiple summits in Δ G When, the present invention is also according to the method for increasing a line, a line in Δ G per treatment, and safeguards the pos of each point () variable simultaneously updates MSTa.Algorithm 1 is obtained with the MSTa of update.
The time complexity of parser 1 of the present invention below.It is to update adjacent side list, that is, the 1st of algorithm 1 the first Row, time complexity be O (| E ∪ Δ E+|).For each side e in Δ G, if e meets the condition of the 3rd row, algorithm meeting Scan v go out side, judge and in the same way, check whether the descendant nodes of v need to update.The worst situation is exactly by tense All sides are all scanned one time in figure.Therefore algorithm 1 time complexity be O (| E ∪ Δ E+|).Card is finished.
Part 2: the case where deleting side
This introduction temporal diagram deletes the case where side, and the present invention still starts to introduce for deleting a line, under Side e=(u, v, the t that face part is deletedu,tv, w) and ∈ Δ E- indicates that the present invention first provides lemma 2.
Lemma 2: if deleting a line e=(u, v, t from figure Gu,tv, w), then the value of A (v) only will increase or protect It holds constant.
It proves: assuming that A (v) becomes smaller after deleting side e.It means that in temporal diagram there are one from root node to The path of v, it meets time-constrain, and can than A (v) original value also than early reach node v.When so with defining in 3 Between the definition of minimum spanning tree contradict.If the side e deleted is not in initial MSTa, A (v) will be remained unchanged, because It was not selected into tree natively originally for this edge.If the side e deleted is in initial MSTa, and in temporal diagram not In the presence of time-constrain is both met, arrival time is all the side of A (v) again, then A (v) ratio will become larger at this time, if there is meeting the time Constraint, and arrival time is all the side of A (v), then A (v) will be remained unchanged.Card is finished.
Theorem 2: forAnd v ≠ r, deleting side e=(u, v, tu,tv, w), after, if A (v) becomes larger, by Influence the descendant nodes that node is initial minimum spanning tree interior joint v and v.
It proves: assuming that deleting side e=(u, v, tu,tv, w) and A (v) becomes larger afterwards, and v has one to go out side e ' arrival node v '.Cause Become larger for A (v), then the initial time of e ' may be less than A (v), at this point,<e, e '>it will no longer satisfy time-constrain, therefore It needs to pick up one to reach v ' and meet the path of time-constrain, after picking up satisfactory path, updates v ' Earliest arrival time and its father node.If A (v ') becomes larger, the child nodes that can determine whether it according to same method are It is no to need to update.Therefore affected node integrate as in minimum spanning tree using node v as the subtree of root in all nodes, indicate For Vs, and be V by the unaffected node set representations in temporal diagramu, i.e. Vu=G-Vs.Following present invention proves VuIn node It is really unaffected.By front VsAnd VuDefinition it is found that in path P (r, x) centainly do not include VsIn node.Institute With when deleting side e, the node in path P (r, x) is unaffected, A (x) and P (x) be will not change, and thus can be demonstrate,proved as deletion side e When, affected node collection is the descendant nodes of initial minimum spanning tree interior joint v and v.Card is finished.
According to lemma 2 and theorem 2, it is recognised that if the side e to be deleted not in initial MSTa, A (v) and P (v) will not change, then MSTa will also be remained unchanged.If the side e to be deleted, in initial MSTa, A (v) and P (v) can It can change.Node v and its descendant nodes are all affected nodes.Therefore when deleting a line, from this edge It reaches node to start, constantly judges whether the descendant nodes of it and it will update, why be worth as updating, only need more impacted Node it is all enter side.
The case where including multiple summits, is now discussed in Δ G.It is identical with the case where deleting a line, to determine impacted section Then point is updated these nodes.Specific steps are given below:
(1) storage organization that figure is first updated according to original image G and changes delta G, will keep each node to go out side by the departure time Sequence from big to small is constant.
(2) all sides in Δ G are judged, if it is the side in initial minimum spanning tree (initial MSTa), then will Set V is added in the arrival node on the sides, and V will be also added to for the point in the subtree of root with these in initial MSTasIn.
(3) to VsIn node initialized, earliest arrival time is initialized as infinity, father node is initialized as- 1, pos value is initialized as 1 and (is recorded in E with pos (v)o(v) position of Current Scan).
(4) side for meeting following two condition is first put into stack S: the start node of (i) this edge is not in set VsIn, Node is reached in set VsIn;(ii) this edge meet time-constrain (i.e. the departure time of this edge be greater than the side start node A value).(side for meeting the two conditions belongs to VsInterior joint enters side, if start node is also in VsIn then the side it is certain It is unsatisfactory for time-constrain, because of VsThe A value of interior joint has been initialized to ∞.As long as therefore selection is in VsInterior joint enters in side Meet time-constrain).
(5) take out stack S in a line, judge its whether can the arrival node to this edge impact (i.e. this edge Arrival time whether than reach node A value it is small).If do not impacted, continue to take the side in stack S, until it has It influences or stack S is sky;If causing influence, perform the next step.
(6) earliest arrival time and its father node (i.e. A and P value) of the node are updated according to this edge, A value is updated to this The arrival time on side, P value are updated to the start node of this edge.Then judge the node goes out side, meets time-constrain then Stack S is added.
(7) circulation step (5) and (6), until stack S is sky, i.e., the earliest arrival time (i.e. A value) of node does not change. It is finished at this point, time minimum spanning tree updates.
The pseudocode for deleting the time minimum spanning tree delta algorithm of rim portion is given below.
Theorem 3: algorithm 2 time O (| E- Δ E-|) in return one update MSTa, wherein | E- Δ E-| it is new tense The number of edges of figure.
Prove: according to theorem 2, when deleting side e, affected node is the descendant nodes of v and it.The present invention is found Impacted node, then scan these nodes enter while and out while, can finally return one update MSTa.
The traversal affected node of algorithm 2 enters while with out, and the worst situation is exactly to need to be traversed in new temporal diagram to own Side.Therefore time complexity be O (| E- Δ E-|), wherein | E- Δ E- | it is the number of edges of new temporal diagram.
The present invention is also that the part on deletion side proposes a kind of Pruning strategy.
Side e=(u, v, t in deleting initial MSTau,tv, w) after, the present invention can be updated according to above-mentioned delta algorithm MSTa.Assuming that A (v) becomes larger after updating at this time, according to algorithm 2, v and its all descendant nodes will be added to affected node It concentrates.But in fact, the part descendant nodes of v can't be affected in fact.For example, v ' is a child nodes of v, e ' Be in initial MSTa from v to v ' tense side.After deleting side e, the more earliest arrival time of new node v obtains new A (v), But A (v) is still not more than the departure time of e ' at this time, i.e., e ' still meets time-constrain at this time, then v ' will be unaffected.Therefore with V ' is that the subtree of root is unaffected, and the descendant nodes of v ' and v ' should not be divided into affected node concentration.Passing through will Node v ' and its descendant nodes are concentrated from affected node to be removed, it is possible to reduce the number of edges scanned required for algorithm 2, thus plus Fast algorithm speed.Based on above method, the size of impacted subgraph is reduced the invention proposes Pruning strategy.
Traverse Δ G in deletion in need side, available destination node collection Vd.Because it is known that each node exists The number of plies in initial MSTa, then by former affected node collection VsIn node according to the number of plies in initial MSTa by greatly to It is small to be ranked up (V at this timesFor VdIn node and these nodes descendant nodes).It is given below with reference to the minimum spanning tree in Fig. 7 Specific beta pruning step out, it is assumed that delete the v in Fig. 70,v2Between side and v2, v4Between side, then VdInclude v2And v4
If in the path P (r, v) from root node r to node v including node u, wherein u ∈ VdAnd u ≠ v, that To VsInterior joint v and its descendant nodes are marked.Because existing when in the path P (r, v) from root node r to node v When other affected nodes, then v just can not directly determine whether it is impacted.So P (v in the tree of Fig. 70,v4) it include node v2, so v4Can not directly determine whether it is impacted, mark with v4For the subtree of root.
If not including node u in the path P (r, v) from root node r to node v, wherein u ∈ VdAnd u ≠ v, So when deleting using v as the side of purpose node, its descendant nodes may be unaffected.Then Pruning strategy carries out following Step further judges whether the descendant nodes of v can be by beta prunings.So P (v in the tree of Fig. 20,v2) be free of VdIn node, institute With v2Descendant nodes be possible to can be with beta pruning.
(1) v is marked, i.e. v in Fig. 22
(2) estimated value is indicated A ' (v) by the new earliest arrival time value for estimating v.Take V-VsInterior joint is to the side of point v The smallest middle arrival time is A ' (v), i.e. A ' (v)=min (tv|(u,v,tu,tv,w),u∈V-Vs).It is corresponding to this example V in temporal diagram after deleting side0,v1,v3Reach v2Earliest time as estimated value.
(3) check whether the most arrival time estimated value A ' (v) of v can impact the unlabelled child nodes of v, i.e., Judge in initial MSTa, whether v also meets time-constrain to its side of child nodes.If being unsatisfactory for time-constrain, say It is bright the child nodes to be impacted, it will be marked by the point in the subtree of root of the child nodes;If still met Between constrain, illustrate not impact child, then not marking, beta pruning can be carried out by the subtree of root of these nodes, then From VsMiddle these nodes of rejecting.Corresponding to this example, child nodes v5It is unmarked, if meet time-constrain can beta pruning, otherwise will be into Line flag.
(4) when successively having traversed VsIn after all nodes, VsIn to be left labeled node be exactly still impacted after beta pruning Node.
Affected node number can be reduced by the above pruning method, to reduce the number of edges that algorithm 2 needs to scan, is reached Accelerate the purpose of speed.
Embodiment 2
In order to which technical solution of the present invention is more clearly understood, below with reference to experimental result, specific implementation and attached drawing The present invention will be further described.
Experimental result:
Experimental situation of the invention is as follows: CPU is Intel (R) Core (TM) i3-6100CPU 3.70GHz, is inside saved as 8GB, operating system are Windows 10 64, and programming language used by testing is C++.
The data that this experiment uses are Slashdot, Facebook, HepPh, Epinions and Enron, these are all true Real network data.Data set Slashdot is the network that the user collected from technology web sites Slashdot exchanges.Data set Facebook is the figure that user is sent to other user informations on facebook.Data set HepPh is the science by high-energy physics The cooperative network of Authors of Science Articles, node on behalf author therein publish object cooperatively between two authors while representing.Data set Epinions has recorded product on line and grades, and wherein side indicates to trust and mistrustful link between user.Data set Enron note E-mail communication of the Enron company personnel between 1999 to 2003 is recorded.
Following table is the simple scenario of data set.Wherein | V | indicate number of nodes, | E | indicate number of edges, deg indicates the data set The maximum degree of interior joint, π indicates the Maximum edge numbers between temporal diagram any two node, when Time indicates maximum in data set Between be spaced.
1 data set of table
Dateset |V| |E| deg π Time
Slashdot 131k 140k 3622 17 81590764
Facebook 46k 877k 2696 157 137494859
HepPh 28k 9193k 11134 262 345306368
Epinions 131k 717k 3622 1 81590438
Enron 87k 1135k 38785 1566 1401194717
These data are all temporal diagrams, and the present invention uses the time in data as initial time, then random to increase by one A numerical value is as arrival time.Some data be it is free, the cost of each edge is set w (e)=log by the present invention | di(v) |, wherein | di(v) | enter number of edges amount for the arrival node v of side e.As for the selection of spanning-tree root node, present invention selection Using the node in the spanning tree of root, at least to cover the node of 10% node tree in data set as root.
The present embodiment by delta algorithm and Silu Huang of the invention et al. SIGMOD2015 fall into a trap evaluation time minimum The method (for increment problem, he needs to rerun the algorithm in paper one time) of spanning tree compares, present invention difference The side for increasing, deleting 1%, 5%, 10%, 15%, is then separately operable 100 times, takes the average time as final result, in order to Test the validity of inventive algorithm, it is increased while be minimum spanning tree can be impacted (e=while i.e. increased (u, v,tu,tv, w) and meet tv< A (v) and tu>=A (u)), the side of deletion is also that (can delete what minimum spanning tree impacted While be in initial minimum spanning tree while).The present invention respectively indicates the present invention with MSTa+, MSTa-, MSTa-pruning Processing increase, delete and beta pruning delete delta algorithm, respectively indicated with Baseline+ and Baseline- and use SiluHuang Et al. algorithm come solve increase while and delete while the case where.The runing time knot of minimum spanning tree is updated on five data sets Fruit difference is as shown in the table, it can be seen that delta algorithm MSTa+ is signifi-cantly more rapidly than Baseline+.Because every time increase side when It waits, MSTa+ algorithm utilizes existing preliminary examination minimum spanning tree, greatly reduces the quantity on side to be traversed, therefore can quickly more New MSTa.Delta algorithm MSTa- and MSTa-pruning are also signifi-cantly more rapidly than Baseline-.Because of algorithm MSTa- and MSTa- Pruning ratio Baseline greatly reduces the quantity on side to be traversed, and MSTa-pruning ratio MSTa- faster will illustrate this The Pruning strategy of invention is effective.
2 data set Enron (ms) of table
1% 5% 10% 15%
Baseline+ 8704.96 8737.66 8278.4 8339.66
MSTa+ 8.15 34.58 61.09 101.07
Baseline- 8163.12 8883.92 7947.37 7053.3
MSTa- 845.51 2382.44 3963.11 4968.66
MSTa-pruning 212.11 958.55 2201.62 3254
3 data set HepPh (ms) of table
1% 5% 10% 15%
Baseline+ 24682.8 20033.9 26069.5 25194.8
MSTa+ 921.68 3041.21 3137.68 3114.88
Baseline- 24734.5 17422.5 21966.1 21987.3
MSTa- 3257.57 13397.6 19262.7 27780.9
MSTa-pruning 605.21 4798.13 10308.51 14596
4 data set Facebook (ms) of table
5 data set Slashdot (ms) of table
1% 5% 10% 15%
Baseline+ 198.89 138.12 154.12 172.4
MSTa+ 0.57 2.20 2.2 7.03
Baseline- 214.72 143.17 143.17 185.6
MSTa- 21.61 103.58 103.58 218.33
MSTa-pruning 8.21 47.76 47.76 143.21
6 data set Epinions (ms) of table
1% 5% 10% 15%
Baseline+ 875.89 845.62 862.09 870.37
MSTa+ 0.77 4.75 10.66 15.47
Baseline- 868.55 663.25 761.57 814.16
MSTa- 51.19 303.21 571.48 698.87
MSTa-pruning 27.84 161.76 356.88 478.74
Experimental example 1:
Known temporal diagram G as shown in Figure 1, enabling node 0 is root, the time minimum spanning tree of G as shown in Fig. 2, in Fig. 1 when State figure increases side (v0,v1, 1,2,1), new temporal diagram is as shown in Figure 3 after increase.
Since it is known the time minimum spanning tree of temporal diagram G, and so knows that the earliest arrival time of each node, father node With scanning to node go out while position (i.e. for node u out while (u, v, tu,tv, w) in, tuThe position of a line of < A (u) Set), i.e., known following data:
A(v0P (the v of)=00)=v0 pos(v0)=5
A(v1P (the v of)=31)=v0 pos(v1)=3
A(v2P (the v of)=52)=v0 pos(v2)=3
A(v3P (the v of)=63)=v1 pos(v3)=1
A(v4P (the v of)=64)=v2 pos(v4)=1
A(v5P (the v of)=85)=v2 pos(v5)=1
When increasing side, the adjacent side list of temporal diagram is updated first, the sequence of departure time non-increasing is still kept, after update As a result are as follows:
v0,<v1,5,6,2> <v2,3,6,3> <v1,2,3,2> <v2,1,5,2> <v1,1,2,1>
v1,<v4,6,7,1> <v3,5,6,1> <v3,2,3,2>
v2,<v5,6,8,2> <v4,5,6,2>
v4,<v0,8,9,1>
Increased side e=(v0,v1, 1,2,1) and meet conditionAnd tv0=1 >=A (v0)=0, that is, increase This edge meet time-constrain, and this edge reaches the arrival time of node, than in initial time minimum spanning tree Earliest arrival time want small.So, just (v0,v1, 2) and it is put into stack S, start renewal time minimum spanning tree, such as algorithm The 4th row in 1.
A line is taken out from stack S, judges whether it has smaller arrival time, if so, then updating.At this point, Taking side is (v0,v1, 2), the more earliest arrival time of new node 1, A (v after update1)=2, P (v1)=1.Then start inspection 1 Go out side be then put into stack S if there is meeting the side of time-constrain.(v is found by checking1,v3, 2,3,2) and meet the time Constraint, therefore by (v1,v3, 3) and it is put into stack S.Repeating the above process can renewal time minimum spanning tree.When updated Between minimum spanning tree it is as shown in Figure 4.
Experimental example 2:
Known temporal diagram G is as shown in Figure 1, enable node v0For root, the time minimum spanning tree of G is as shown in Fig. 2, in such as Fig. 1 Shown in side (v is deleted in temporal diagram0,v2,1,5,2)、(v2,v4, 5,6,2), the new temporal diagram after deletion is as shown in Figure 5.
Because identical with temporal diagram in embodiment 1, section is arrived in earliest arrival time, father node and the scanning of each node Point out while position (i.e. for node u go out while (u, v, tu,tv, w) in, tuThe position of a line of < A (u)), i.e., it is known Following data:
A(v0P (the v of)=00)=v0 pos(v0)=5
A(v1P (the v of)=31)=v0 pos(v1)=3
A(v2P (the v of)=52)=v0 pos(v2)=3
A(v3P (the v of)=63)=v1 pos(v3)=1
A(v4P (the v of)=64)=v2 pos(v4)=1
A(v5P (the v of)=85)=v2 pos(v5)=1
When deleting side, the adjacent side list of temporal diagram is updated first, the sequence of departure time non-increasing is still kept, after update As a result are as follows:
v0,<v1,5,6,2> <v2,3,6,3> <v1,2,3,2>
v1,<v4,6,7,1> <v3,5,6,1> <v3,2,3,2>
v2,<v5,6,8,2>
v4,<v0,8,9,1>
Secondly, from the available affected node collection V of side collection of deletionsFor { v2,v4,v5}.And these nodes are carried out just Beginningization:
A(v2)=∞ P (v2Pos (the v of)=- 12)=1
A(v4)=∞ P (v4Pos (the v of)=- 14)=1
A(v5)=∞ P (v5Pos (the v of)=- 15)=1
Then in temporal diagram interior joint v2,v4,v5Enter found in meet time-constrain while, be put into stack S.Meet There are two (v on the side of time-constrain0,v2,3,6,3)(v1,v4, 6,7,1), then by (v0,v2,6)(v1,v4, 7) and it is put into stack S.
Pop operations are carried out below, scan side.It is identical with part operation of popping in experiment 1.
The time minimum spanning tree of update is finally obtained, as shown in Figure 6.
Embodiment 3
The pruning method of embodiment 1 is illustrated below.
Delete the arrival node collection D={ v on side4,v2, and node is descending according to the number of plies of place minimum spanning tree It is arranged.
According to the arrival node set for deleting side, affected node collection V is first initializeds={ v2,v4,v5}.Below by cutting Branch strategy is further reduced affected node.
1, since D the maximum node of the number of plies, i.e. v4.If from root node v0To v4Between have other deletion of node, i.e., v2.So with node v4It is unable to beta pruning for the subtree of root node, by node v4With its descendant nodes in VsMiddle label.Vs={ v2, v4√,v5}
2, next node v is taken from D2.From root node v0To this node v2Between without other deletion of node, that The subtree of this node may beta pruning.
3, first by this node in VsIn V is markeds={ v2√,v4√,v5}
4, node v is estimated2Minimum arrival time, from V-VsIn node { 0,1,3 } in, looking for is v2Predecessor node, and Arrival time is the smallest, so A ' (v2)=min (tv|(u,v2,tu,tv,w),u∈{v0,v1,v3, so taking u is 0, A ' (v2) it is 6.
5, judge A ' (v2) to VsIn do not have whether markd child has an impact.v2Child there are two v4,v5.Node v4? Through being labeled, skip.Node v5It is not labeled, if A ' (v2) to v5Do not influence, then can beta pruning, v5And v5Descendant nodes do not mark Note, and from VsMiddle rejecting.
Finally determining affected node is Vs={ v2,v4}.Then proceed to execute in algorithm 2 5-19 row further more New time minimum spanning tree.But because reducing affected node number, Pruning strategy can renewal time be most faster Small spanning tree.
Obviously, the above embodiment of the present invention be only to clearly illustrate example of the present invention, and not be pair The restriction of embodiments of the present invention.For those of ordinary skill in the art, may be used also on the basis of the above description To make other variations or changes in different ways.There is no necessity and possibility to exhaust all the enbodiments.It is all this Made any modifications, equivalent replacements, and improvements etc., should be included in the claims in the present invention within the spirit and principle of invention Protection scope within.

Claims (3)

1. a kind of increment method of the time minimum spanning tree based on temporal diagram includes the case where feelings when increasing while and deleting Condition, it is characterised in that: including the following contents:
One, the case where increasing side
(1) storage organization that figure is updated according to original image G and changes delta G, keep each node go out side by the departure time from greatly to Small sequence;
(2) judge whether the new side of insertion can reach node v to it and impact;If do not impacted, do not need more New minimum spanning tree MSTa, terminates;If impacted, perform the next step;
(3) A (v) and P (v) are updated, A (v) is updated to the arrival time t of this edgev, P (v) is updated to the start node of this edge u;Wherein, P (v) indicates that father's node in time minimum spanning tree interior joint v, A (v) indicate at time minimum spanning tree midpoint The earliest arrival time of v, then according to when the going out of sequential scan v of v gone out in adjacent list, if new side meets the time about Beam is just added in stack S;
(4) take out stack S in a line, judge its whether can the arrival node to this edge impact;If do not caused Influence, then continue to take the side in stack S, until its have an impact or stack S for sky;If causing influence, perform the next step;
(5) earliest arrival time and its father node of the node are updated;Then judge the node goes out side, and new side meets the time about Stack S is then added in beam;
(6) circulation step (4), (5) are until stack S is empty, i.e., the earliest arrival time of node does not change;At this point, the time is minimum Spanning tree update finishes;
Two, the case where deleting side
(1) storage organization that figure is first updated according to original image G and changes delta G, keep each node goes out side by the departure time from big To small sequence;
(2) all sides in Δ G are judged, if it is the side in initial minimum spanning tree MSTa, then by the arrival on the side Set V is added in nodes, and V will be also added to for the point in the subtree of root with these in initial minimum spanning tree MSTasIn;
(3) to VsIn node initialized, earliest arrival time is initialized as infinity, and father node is initialized as -1, pos Value is initialized as 1, and the position for going out Current Scan in side of v is recorded in pos (v);
(4) side for meeting following two condition is first put into stack S: the start node of (i) this edge is not in set VsIn, it reaches Node is in set VsIn;(ii) this edge meets time-constrain, i.e. A of the departure time of this edge greater than the side start node Value;
(5) take out stack S in a line, judge its whether can the arrival node to this edge impact;If do not caused Influence, then continue to take the side in stack S, until its have an impact or stack S for sky;If causing influence, perform the next step;
(6) earliest arrival time and its father node, i.e. A and P value of the node are updated according to this edge, A value is updated to this edge Arrival time, P value is updated to the start node of this edge;Then judge the node goes out side, meets time-constrain and is then added Stack S;
(7) circulation step (5) and (6), until stack S is sky, i.e., the earliest arrival time of node does not change;At this point, the time is most Small spanning tree update finishes.
2. the increment method of the time minimum spanning tree according to claim 1 based on temporal diagram, it is characterised in that: described Second part was deleted in the step of side (2), and node is added to VsIn after, to VsIn node carry out beta pruning processing:
(1) V is useddIt indicates the destination node collection on deletion side, and presses the descending arrangement of the number of plies of the node in initial MSTa;
(2)If from root node r to including V on the path of node vdIn other nodes, to VsInterior joint v and it Descendant nodes are marked;If from root node r to not including V on the path of node vdIn other nodes, perform the next step;
(3) v is marked;
(4) estimated value is indicated A ' (v) by the new earliest arrival time value for estimating v;
(5) it checks whether the most arrival time estimated value A ' (v) of v can impact the unlabelled child nodes of v, that is, judges In initial MSTa, whether v also meets time-constrain to its side of child nodes;If being unsatisfactory for time-constrain, illustrate meeting The child nodes are impacted, will be marked by the point in the subtree of root of the child nodes;If still meeting the time about Beam illustrates not impact child, then not marking, beta pruning can be carried out by the subtree of root of these nodes, from VsIn pick Except these nodes;
(6) when successively having traversed VsIn after all nodes, VsIn to be left labeled node be exactly still impacted section after beta pruning Point.
3. the increment method of the time minimum spanning tree according to claim 1 or 2 based on temporal diagram, it is characterised in that: The time minimum spanning tree MSTa is one tree T=(Vr,Er), meet the following conditions:
(1) node collection VrInclude all accessibility nodes of root node r in figure G;
(2)And v ≠ r, v only have one and enter side, r does not enter side;
(3)And v ≠ r, the path P (r, v) from r to v keep the arrival time of invocation point v earliest, the earliest arrival of node v Time is indicated with A (v).
CN201811244600.7A 2018-10-24 2018-10-24 A kind of increment method of the time minimum spanning tree based on temporal diagram Pending CN109460493A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811244600.7A CN109460493A (en) 2018-10-24 2018-10-24 A kind of increment method of the time minimum spanning tree based on temporal diagram

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811244600.7A CN109460493A (en) 2018-10-24 2018-10-24 A kind of increment method of the time minimum spanning tree based on temporal diagram

Publications (1)

Publication Number Publication Date
CN109460493A true CN109460493A (en) 2019-03-12

Family

ID=65608292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811244600.7A Pending CN109460493A (en) 2018-10-24 2018-10-24 A kind of increment method of the time minimum spanning tree based on temporal diagram

Country Status (1)

Country Link
CN (1) CN109460493A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602715A (en) * 2019-09-25 2019-12-20 北京邮电大学 Wireless access network and baseband function deployment method based on minimum spanning tree

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602715A (en) * 2019-09-25 2019-12-20 北京邮电大学 Wireless access network and baseband function deployment method based on minimum spanning tree

Similar Documents

Publication Publication Date Title
Nardelli et al. Finding the most vital node of a shortest path
Guo et al. Influence maximization in trajectory databases
US9075734B2 (en) Method for updating betweenness centrality of graph
Kara et al. Formulations for minimizing tour duration of the traveling salesman problem with time windows
Van Beek et al. Machine learning of Bayesian networks using constraint programming
Abdelhamid Multi-label rules for phishing classification
CN107480213B (en) Community detection and user relation prediction method based on time sequence text network
Zhou et al. Overlapping influence inspires the selection of multiple spreaders in complex networks
Saravanan et al. Concept of integrity and its value of fuzzy graphs
CN109460493A (en) A kind of increment method of the time minimum spanning tree based on temporal diagram
Xia et al. Toward solving the Steiner travelling salesman problem on urban road maps using the branch decomposition of graphs
CN109299443B (en) News text duplication eliminating method based on minimum vertex coverage
George et al. A framework for inventor collaboration recommendation system based on network approach
Yen The connected p-center problem on block graphs with forbidden vertices
Gunturi et al. Minimum spanning tree on spatio-temporal networks
Nejma et al. A beam search for the equality generalized symmetric traveling salesman problem
Saha et al. Sparsification and sampling of networks for collective classification
Demaine et al. Approximating the canadian traveller problem with online randomization
Zhang et al. A stabilized branch-and-price-and-cut algorithm for the waste transportation problem with split transportation
CN107239515A (en) The reachable querying method and system of a kind of Large Scale Graphs based on four-dimension index
Shi et al. An overlapping community discovery algorithm based on label propagation
Uemura et al. Unsupervised spam detection by document complexity estimation
Fiorenza et al. Polynomial recognition of vulnerable multi-commodities
Thai et al. Saphyra: A learning theory approach to ranking nodes in large networks
CN109389179A (en) A kind of smooth group dividing method of timing and device based on label diffusion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190312

RJ01 Rejection of invention patent application after publication