Movatterモバイル変換


[0]ホーム

URL:


CN106033342A - Method and system for generating random graph - Google Patents

Method and system for generating random graph
Download PDF

Info

Publication number
CN106033342A
CN106033342ACN201510115386.5ACN201510115386ACN106033342ACN 106033342 ACN106033342 ACN 106033342ACN 201510115386 ACN201510115386 ACN 201510115386ACN 106033342 ACN106033342 ACN 106033342A
Authority
CN
China
Prior art keywords
node
side information
limit
self
goes out
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
CN201510115386.5A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
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 Alibaba Group Holding LtdfiledCriticalAlibaba Group Holding Ltd
Priority to CN201510115386.5ApriorityCriticalpatent/CN106033342A/en
Publication of CN106033342ApublicationCriticalpatent/CN106033342A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

The invention provides a method and a system for generating a random graph. The method comprises: inputting an original graph structure; selecting two edges in the original graph structure at will, when the original graph structure does not have an edge which is from a giving-out node of a first edge to an end node of a second edge and the giving-out node of the first edge and the end node of the second edge are not a same node, changing edges of the original graph according to the first edge and the second edge, that is, deleting the first edge and the second edge, and adding an edge from the giving-out node of the first edge to the end node of the second edge, and an edge from a giving-out node of the second edge to the end node of the first edge, and repeating the process of selecting edges and changing edges, until preset iteration number is executed. Thus, a random graph which is consistent in node number and edge number with the original graph structure can be obtained, and out-degree and in-degree of each node are consistent. In addition, the method can greatly reduce time complexity and storage capability of a graph structure, and provides convenience for generating the random graph in large data volume graph structure.

Description

Random map generalization method and system
Technical field
The application relates to networking technology area, particularly to random map generalization method and system.
Background technology
Along with the development of network technology, various complex networks, progressively occur also such as neutral net, social networks, citation network etc.Fast-developing.When these complex networks are researched and analysed, it is often necessary to understanding some modular character in complex network isNo significantly.But, it is not quite similar due to the number of nodes of each complex network, limit quantity, degree distribution etc., different complex networksBetween modular character lack comparability.And the modular character of single complex network can be the most corresponding with it random network carry out rightRatio, thus obtain the absolute index of the modular character of this complex network, thus, i.e. may be implemented in and carry out between different complex networkContrast.
The Stochastic Networks that the random network the most corresponding with live network, the out-degree of i.e. each with live network node and in-degree are identicalNetwork, is also designated as Random Graph, it is possible to for live network is carried out characteristic present.For small data figure, can be by numerousThe random algorithm of low time complexity generates Random Graph, but, when the data volume of datagram reaches hundred million grades, traditional algorithm frameFrame then because being limited to time complexity and cannot store the problem of magnanimity graph structure, then cannot carry the function generating Random Graph.CauseThis, a kind of low time complexity for big data quantity complex network and the random map generalization method of magnanimity graph structure can be stored haveWait to propose.
Summary of the invention
The application is intended to solve above-mentioned technical problem the most to a certain extent.
To this end, the first of the application purpose is to propose a kind of random map generalization method,.
Second purpose of the application is to propose a kind of random map generalization system.
For reaching above-mentioned purpose, propose a kind of random map generalization method according to the application first aspect embodiment, including following stepRapid: S1, input original graph structure, wherein, described original graph structure includes N number of node, and wherein, N is positive integer;S2, selecting M seed node among described N number of node, in described M seed node, each node chooses Q respectivelyBar goes out limit and generates Q bar first and go out side information, and sends described respectively to any Q in addition to self other nodes respectivelyQ bar first goes out side information, and Q bar goes out limit locking;S3, described N number of node receive described first and goes out side informationNode go out side information according to receive first and judge whether to meet pre-conditioned, pre-conditioned, then from self as described in meetSelect any bar go out limit and generate second and go out side information, and go out side information by described second and feed back to send described first and go out limit letterThe node of breath;S4, described N number of node receive the described second node going out side information and goes out side information life according to described secondBecome the first exchange instruction and the second exchange instruction, and described second exchange instruction is sent to sending the described second joint going out side informationPoint;S5, receive described second go out side information node perform described first exchange instruction, receive described second exchange instructionNode performs described second exchange instruction;S6, all nodes are gone out limit it is unlocked;And S7, repeat described stepRapid S2-S6, until it reaches preset iterations.
The random map generalization method of the embodiment of the present application, by the original graph structure to input, by appointing from original graph structureMeaning selects two limits, and in original graph structure, there is not Article 1 limit send node to the limit of the end node on Article 2 limit and theArticle one, when the end node sending node and Article 2 limit on limit is not same node, will Article 1 limit and Article 2 edge contract,And add and to the limit of the end node on Article 2 limit and sent node to first by Article 2 limit by the node that sends on Article 1 limitThe limit of the end node on bar limit, to change sides original graph structure, the process on final election limit of laying equal stress on-change sides, until performing to presetIterations, it is possible to obtain consistent with original graph structure node number, limit number, and the out-degree of each node is the most consistent with in-degreeRandom Graph.
Additionally, in each repetitive process select the task in limit-change sides all can executed in parallel, greatly reduce the execution time,After successive ignition, time complexity is also only a minute level.And parallel processing can be greatly increased the information during execution and passThe load capacity of the amount of passing such that it is able to the task in the data volume of 1,000,000,000 ranks that realizes processes.Relative to traditional Random Graph generation sideMethod, greatly reduces the storage capacity of time complexity and graph structure, and the Random Graph of big data quantity graph structure of being more convenient for generates.
The application second aspect embodiment provides a kind of random map generalization system, including input equipment, is used for inputting originalGraph structure, wherein, described original graph structure includes N number of node, and wherein, N is positive integer;And control device, useIn controlling described N number of node repeated execution of steps S2-S6, until it reaches preset iterations, wherein, S2, from described NSelecting M seed node among individual node, in described M seed node, each node is chosen Q bar respectively and is gone out limit and generateQ bar first goes out side information, and sends described Q bar first respectively to any Q in addition to self other nodes respectively and go out limitInformation, and Q bar is gone out limit locking;S3, described N number of node receive described first and goes out the node of side information according to connecingFirst received goes out side information and judges whether to meet pre-conditioned, as described pre-conditioned in met, then go out from self selection any barLimit also generates second and goes out side information, and goes out side information by described second and feed back to send the described first node going out side information;S4、Described N number of node receives the described second node going out side information go out side information according to described second and generate the first exchange instructionWith the second exchange instruction, and by described second exchange instruction send to sending the described second node going out side information;S5, reception instituteStating the second node going out side information and perform described first exchange instruction, the node receiving described second exchange instruction performs described theTwo exchange instructions;S6, all nodes are gone out limit it is unlocked.
The random map generalization system of the embodiment of the present application, by arbitrarily selecting two limits from original graph structure, and ties in original graphThe node that sends that there is not Article 1 limit in structure sends node and second to the limit of the end node on Article 2 limit and Article 1 limitWhen the end node on bar limit is not same node, will Article 1 limit and Article 2 edge contract, and add sending by Article 1 limitNode to the limit of the end node on Article 2 limit and is sent the node limit to the end node on Article 1 limit, with right by Article 2 limitOriginal graph structure is changed sides, the process on final election limit of laying equal stress on-change sides, until performing to preset iterations, it is possible to obtain withOriginal graph structure node number, limit number are consistent, and the Random Graph that the out-degree of each node is the most consistent with in-degree.
Additionally, in each repetitive process select the task in limit-change sides all can executed in parallel, greatly reduce the execution time,After successive ignition, time complexity is also only a minute level.And parallel processing can be greatly increased the information during execution and passThe load capacity of the amount of passing such that it is able to the task in the data volume of 1,000,000,000 ranks that realizes processes.Relative to traditional Random Graph generation sideMethod, greatly reduces the storage capacity of time complexity and graph structure, and the Random Graph of big data quantity graph structure of being more convenient for generates.
The additional aspect of the application and advantage will part be given in the following description, and part will become bright from the following descriptionAobvious, or recognized by the practice of the application.
Accompanying drawing explanation
Above-mentioned and/or the additional aspect of the application and advantage the accompanying drawings below description to embodiment will be apparent from from combining andEasy to understand, wherein:
Fig. 1 is the flow chart of the random map generalization method according to one embodiment of the application;
The schematic diagram of Fig. 2 a BSP framework by being used according to one embodiment of the application;
Fig. 2 b is the superledge composition schematic diagram of the BSP framework according to one embodiment of the application;
Fig. 2 c is the stage schematic diagram comprised according to the superledge of one embodiment of the application;
Fig. 3 a is the schematic diagram of the original graph structure according to one embodiment of the application;
Fig. 3 b is the process schematic diagram of the superledge 0 according to one embodiment of the application;
Fig. 3 c is the process schematic diagram of the superledge 1 according to one embodiment of the application;
Fig. 3 d is the process schematic diagram of the superledge 2 according to one embodiment of the application;
Fig. 3 e is the process schematic diagram of the superledge 3 according to one embodiment of the application;
Fig. 3 f is the process schematic diagram of the superledge 4 according to one embodiment of the application;
Fig. 4 is the structural representation of the random map generalization system according to one embodiment of the application.
Detailed description of the invention
Embodiments herein is described below in detail, and the example of described embodiment is shown in the drawings, the most identical orSimilar label represents same or similar element or has the element of same or like function.Describe below with reference to accompanying drawingEmbodiment is exemplary, is only used for explaining the application, and it is not intended that restriction to the application.
In the description of the present application, it is to be understood that term " " center ", " longitudinally ", " laterally ", " on ", D score, " front ",Orientation or the position relationship of the instruction such as " afterwards ", "left", "right", " vertically ", " level ", " top ", " end ", " interior ", " outward " are baseIn orientation shown in the drawings or position relationship, it is for only for ease of description the application and simplifies description rather than instruction or hint instituteThe device that refers to or element must have specific orientation, with specific azimuth configuration and operation, therefore it is not intended that to the applicationRestriction.Additionally, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint relative importance.
In the description of the present application, it should be noted that unless otherwise clearly defined and limited, term " install ", " being connected "," connect " and should be interpreted broadly, connect for example, it may be fixing, it is also possible to be to removably connect, or be integrally connected;PermissibleIt is to be mechanically connected, it is also possible to be electrical connection;Can be to be joined directly together, it is also possible to be indirectly connected to by intermediary, can be twoThe connection of individual element internal.For the ordinary skill in the art, can understand that above-mentioned term is in the application with concrete conditionIn concrete meaning.
Below with reference to the accompanying drawings random map generalization method and system according to the embodiment of the present application is described.
Fig. 1 is the flow chart of the random map generalization method according to one embodiment of the application.
As it is shown in figure 1, according to the random map generalization method of the embodiment of the present application, comprise the following steps.
S1, inputs original graph structure, and wherein, original graph structure includes N number of node, and wherein, N is positive integer.
Prototype structure figure in the embodiment of the present application can be arbitrary network graph structure, particularly complex network graph structure, such as,Neutral net graph structure, social networks graph structure and citation network graph structure etc. can be but not limited to.
After the initialization operation of S1, can generate, by S2-S7, the Random Graph that original graph structure is corresponding.The application'sIn one embodiment, (Bulk Synchronous Parallel Computing Model, Integral synchronous is counted parallel can to pass through BSPCalculate model) structure perform S2-S6 to generate Random Graph.
BSP structure is to be proposed in nineteen ninety by Valiant, and this model controls to coordinate based on a Master, multiple WorkerWorking machine synchronize perform, data from input queue read, the framework of this model as shown in Figure 2 a, wherein, Client clientEnd enters data into Worker, and notifies that Master starts working, and then waits that Master completes work, and from WorkerExtraction process terminate after data.Master receives the initiation message that Client client sends, and continuous iteration is not until enlivening(active) node is operated that (the Worker node first starting all active during this is operated, and waitsAll Worker update the quantity of the Worker of active after completing work), iteration notifies that Client completes task after completing.Worker is arranged to active state after the data receiving Client input, and then continuous iteration is until being inactive shapeState (first waits the initiation message that Master sends, then reads message from In-Q, and carry out Message Processing etc. during thisWork, and send message, and to whether being that active state is updated, notify that when iteration completes Master completes this and takes turnsIteration works), wherein, when there being message to be sent to Worker, Worker is arranged to active state.
BSP structure is not only a kind of architectural model, is also a kind of method of design concurrent program.BSP programming criterionBeing Integral synchronous (bulk synchrony), it is unique in that the introducing of superledge (super step) concept.One BSP program is sameTime there is the structure of two aspects of horizontal and vertical.From vertical, as shown in Figure 2 b, a BSP program is by a series of stringsSuperledge (super step) composition of row, this is similar to that a serial program structure.From level, in each superledge,All of task parallelism performs local calculation.
As shown in Figure 2 c, each superledge can be divided into the three below stage.
1) the local computing stage, the data in each processor only internal memory local to storage carry out local computing.
2) the global communication stage, any non-local data is operated (interactive operation).
3) fence synchronous phase, waits the end of all communication behaviors.
Thus, S2-S6 can be realized by superledge 0-4 of BSP structure respectively, specific as follows.
S2, selects M seed node among N number of node, and in M seed node, each node is chosen Q bar respectively and gone outLimit also generates Q bar first and goes out side information, and sends Q bar first respectively to any Q in addition to self other nodes respectivelyGo out side information, and Q bar is gone out limit locking.
In an embodiment of the application, among N number of node, select M seed node specifically include: by N number of jointPoint has the node on limit as seed node.Further, M seed node is chosen Q bar by below equation and is gone out limit:
Q=ceil (| Out (i) |/2) (1)
Wherein, what | Out (i) | was node i goes out limit quantity, and ceil () is the function that rounds up.
Specifically, step S2 can be realized by the superledge 0 in BSP structure, i.e. super step=0.
As super step=0, for each node in N number of node of original graph structure, if it exists limit, then may be usedUsing this node as seed node.Limit, and root is gone out from Q=ceil (| Out (i) |/2) bar that goes out to randomly select limit of each seed nodeGo out limit generation one first according to every and go out side information.Then Q bar first goes out side information be respectively sent to except first goes out limit letterBreath sends Q node outside node, that randomly select.Wherein, first go out side information include limit corresponding send nodeAnd peripheral node, be represented by [srcVertexId1, destVertexId1], wherein, srcVertexId1 be limit corresponding send jointPoint ID (Identity, identity), destVertexId1 is the peripheral node ID that limit is corresponding.
In embodiments herein, when inputting original graph structure, the original state on the limit in original graph structure is arranged to notThe value of lock-out state, i.e. limit is set to 0.When M seed node selects Q bar limit, and to except any Q of self fingerprintAfter other nodes individual occur Q bar first to go out side information respectively, the Q bar chosen can go out limit locking, the Q bar that will choose goes outThe value on limit is set to 1.
For example, for the prototype structure figure as shown in Figure 3 a inputted, there are 8 nodes, be respectively1,2,3,4,5,6,7,8, and 6 limits as shown in Figure 3 a.Wherein, node Isosorbide-5-Nitrae, 5,7,8 have limit, therefore, and node Isosorbide-5-Nitrae, 5,7,8Can be chosen for seed node, its quantity going out limit is respectively 1,1,1,1,2.Can obtain according to formula (1): node 1,4,5,7,8 canThe limit quantity that goes out selected is respectively 1,1,1,1,1.Then, as shown in Figure 3 b, illustrate as a example by node 8 and node 5,Limit can select one go out limit 8-> 5 from going out of node 8 at random, and generate this and go out the first of limit and go out side information [8,5] (dash-dotted gray lineRepresent transmission process), and send to any one node (such as sending to node 4) in addition to node 8, and by this 8-> 5The value on limit is set to 1, locks.Also limit can select one go out limit 5-> 2 from going out of node 5 at random, and generate this and go out limitFirst go out side information [5,2], and send to any one node (such as sending to node 6) in addition to node 5, and willThe value on this 5-> 2 limit is set to 1, locks.Wherein, locked limit grey filled lines represents.
S3, receives first and goes out the node of side information and go out side information according to receive first and judge whether to meet pre-in N number of nodeIf condition, as pre-conditioned in met, then from self selecting any bar go out limit and generate second and go out side information, and go out limit by secondInformation feeds back to send the first node going out side information.
In an embodiment of the application, N number of node receives the first node going out side information and goes out side information according to first and sentenceBreak and whether meet pre-conditioned specifically including: N number of node receives the first node going out side information and judges whether self hasLimit;If receiving the first node going out side information there is limit, then determine whether that the first peripheral node going out in side information isNo exist or from as the first peripheral node going out in side information in going out in limit of self;And if first go out the end in side informationPoint node does not exists in limit in going out of self and self is not that (destVertexId1 is not equal to the first peripheral node going out in side information4), then judgement meets pre-conditioned.
Specifically, step S3 can be realized by the superledge 1 in BSP structure, i.e. super step=1.
As super step=1, for each node in original graph structure, this super step=1 safeguards a List,For deposit this node all of go out limit, be the most i.e. called for short with List.If a node receives first and goes out side information, and shouldThere is limit in node, then judges that receive first goes out the destVertexId1 in side information [srcVertexId1, destVertexId1]Whether it is equal to this node ID at go out existence or the destVertexId1 in limit of this node.If destVertexId1 is at this nodeGo out in limit and do not exist, and destVertexId1 is not equal to the ID of this node, then sentence and meet condition, and select at random from ListTake a limit (the peripheral node ID on this unidirectional limit is destVertexId2), and (send to the node that ID is srcVertexId1First goes out sending of side information) transmission second goes out side information.
Wherein, second go out side information can include receiving first go out the node of side information from self select go out limit corresponding send jointPoint and peripheral node and first go out peripheral node included in side information, are represented by: [srcVertexId2,DestVertexId2, destVertexId1], wherein, srcVertexId2 is to receive the first node going out side information to select from selfGo out limit corresponding send node, destVertexId2 be receive first go out the node of side information from self select to go out limit correspondingPeripheral node, destVertexId1 is first to go out in side information included peripheral node.
For example, what Fig. 3 b interior joint 4 received that node 8 sends first goes out side information [8,5], and node 6 receives node 5First sent goes out side information [5,2], then node 4 and 6 judges whether self has limit respectively.Owing to node 6 does not go out limit,Then node 6 is unsatisfactory for pre-conditioned, and the conversion process of node 6 correspondence terminates.And node 4 has one to go out limit 4-> 3, and node4 receive first go out side information [8,5] send node not in this goes out limit 4-> 3, and node 4 is not first to go out side informationThe peripheral node of [8,5], therefore, node 4 meets pre-conditioned.
And then, as shown in Figure 3 c, randomly choose one of node 4 and go out limit 4-> 3, and generate second and go out side information [4,3,5],And what the node 4 receives first node 8 when going out side information sent, therefore, node 4 feeds back second to node 8 and goes out side information[4,3,5]。
S4, receives the second node going out side information and goes out side information according to second and generate the first exchange instruction and second in N number of nodeExchange instruction, and the second exchange instruction is sent to sending the second node going out side information.
In one embodiment of the invention, N number of node receives the second node going out side information and goes out side information life according to secondThe first exchange instruction and the second exchange instruction is become to specifically include: N number of node to receive the second node going out side information and checks selfGo out whether limit exists receive first go out the node of side information from self select go out peripheral node corresponding to limit or from asReceive first to go out the node of side information and go out, from self select, the peripheral node that limit is corresponding;And if receive first go out limit letterThe node of breath does not exists and self does not goes out side information for receiving described first from peripheral node corresponding to limit that go out self selectedNode from the peripheral node that limit is corresponding that goes out self selected, then generates the first exchange instruction and the second exchange instruction.
Wherein, the first exchange instruction and the second exchange instruction are changed sides for control, will the limit that go out of two nodes swap, byThis, although the limit of the network of generation there occurs change, but the out-degree of each node is still consistent with artwork structure with in-degree.Specifically, step S4 can be realized by the superledge 2 in BSP structure, i.e. super step=2.
As super step=2, for each node in original graph structure, if node srcVertexId1 receives feedbackSecond goes out side information for [srcVertexId2, destVertexId2, destVertexId1], then node srcVertexId1 checks that it goes out limitIn whether there is destVertexId2 node, and check whether node srcVertexId2 is destVertexId2 node, if nodeSrcVertexId1 go out limit does not exist destVertexId2 node and node srcVertexId2 and destVertexId2 node is notSame node, then start to exchange limit, it may be assumed that transmits the first exchange instruction [-, destVertexId1] and [+, destVertexId2] to nodeSrcVertexId1 (will the first exchange instruction be sent to oneself), and by the second exchange instruction [-, destVertexId2] and[+, destVertexId1] send to node srcVertexId2 (sending the second node going out side information).
For example, for shown in Fig. 3 c when node 8 receive second go out side information [4,3,5] time, node 8 checks node 8Go out whether limit exists and go out peripheral node corresponding to limit (i.e. going out the peripheral node 3 of limit 4-> 3) selected by node 4, due toThe limit that goes out of 8 is 8-> 6 and 8-> 5, there is not node 3, and node 4 is not same node with node 3, therefore, such as figureShown in 3d, the first exchange instruction [-, 5] and [+, 3] can be generated, and send to node 8, and generate the second exchange instruction [-, 3] and[+, 5], and send to node 4.
S5, receives the second node going out side information and performs the first exchange instruction, and the node receiving the second exchange instruction performs secondExchange instruction.
Specifically, step S5 can be realized by the superledge 3 in BSP structure, i.e. super step=3.
As super step=3, receive the second node (namely generating the node of the first exchange instruction) going out side information and performFirst exchange instruction, the node receiving the second exchange instruction performs the second exchange instruction.
For example, as shown in Figure 3 e, node 8 performs the first exchange instruction [-, 5] of oneself generating and [+, 3], i.e. deletes 8-> 5This edge adds 8-> 3 this edge simultaneously;Node 4 have received the second exchange instruction [-, 3] and [+, 5], then delete 4-> 3 this edgeAdd 4-> 5 this edge simultaneously.
All nodes are gone out limit and are unlocked by S6.
Specifically, step S6 can be realized by the superledge 4 in BSP structure, i.e. super step=4.
As super step=4, for each node, the value being gone out limit is set to 0, i.e. unlocks.For example, such as Fig. 3 fShown in, the value of the 5-of node 5 > 2 this edge is reseted and 0 is not unlocked (being become the black in Fig. 3 f from the Lycoperdon polymorphum Vitt in Fig. 3 e).
S7, it is judged that whether the execution number of times of step S2-S6 reaches to preset iterations, if reaching to preset iterations, then tiesBundle, otherwise repeated execution of steps S2-S6.
The most constantly repeat above superledge super step0-4, when performing number of times and reaching to preset iterations, terminate, andOutput performs the graph structure obtained for the last time.
Thus, by the executed in parallel local calculation strategy in superledge respectively to the task in step each in S2-S6 atReason, repeats through successive ignition, the execution time that can be substantially reduced, it is achieved the time complexity of minute rank, and can be significantlyThe load capacity of the amount of transmitted information during increase execution such that it is able to the task in the data volume of 1,000,000,000 ranks that realizes processes.
Wherein, presetting iterations PN can be: PN=n*M, wherein, M is the quantity on limit in original graph structure, and n is the most wholeNumber.Experiment proves that, the graph structure generated when n is 100 is fully random.
The random map generalization method of the embodiment of the present application, by arbitrarily selecting two limits from original graph structure, and ties in original graphThe node that sends that there is not Article 1 limit in structure sends node and second to the limit of the end node on Article 2 limit and Article 1 limitWhen the end node on bar limit is not same node, will Article 1 limit and Article 2 edge contract, and add sending by Article 1 limitNode to the limit of the end node on Article 2 limit and is sent the node limit to the end node on Article 1 limit, with right by Article 2 limitOriginal graph structure is changed sides, the process on final election limit of laying equal stress on-change sides, until performing to preset iterations, it is possible to obtain withOriginal graph structure node number, limit number are consistent, and the Random Graph that the out-degree of each node is the most consistent with in-degree.
Additionally, in each repetitive process select the task in limit-change sides all can executed in parallel, greatly reduce the execution time,After successive ignition, time complexity is also only a minute level.And parallel processing can be greatly increased the information during execution and passThe load capacity of the amount of passing such that it is able to the task in the data volume of 1,000,000,000 ranks that realizes processes.Relative to traditional Random Graph generation sideMethod, greatly reduces the storage capacity of time complexity and graph structure, and the Random Graph of big data quantity graph structure of being more convenient for generates.
In order to realize above-described embodiment, the application also proposes a kind of random map generalization system.
Fig. 4 is the structural representation of the random map generalization system according to one embodiment of the application.
As shown in Figure 4, according to the random map generalization system of the embodiment of the present application, including: input equipment 10 with control device20。
Specifically, input equipment 10 is used for inputting original graph structure, and wherein, original graph structure includes N number of node, wherein,N is positive integer.
Prototype structure figure in the embodiment of the present application can be arbitrary network graph structure, particularly complex network graph structure, such as,Neutral net graph structure, social networks graph structure and citation network graph structure etc. can be but not limited to.
Control device 20 to be used for controlling N number of node repeated execution of steps S2-S6, until it reaches default iterations terminates.
In an embodiment of the application, controlling device 20 can be by the superledge of Integral synchronous parallel computational model BSP structure0-4 realizes step S2-S6 to generate Random Graph.More specifically, control device 20 constantly repeat above superledge super step0-4,To repeat S2-S6, when performing number of times and reaching to preset iterations, terminate, and export the figure performing for the last time to obtainStructure, as the Random Graph generated.
BSP structure is to be proposed in nineteen ninety by Valiant, and this model controls to coordinate based on a Master, multiple WorkerWorking machine synchronize perform, data from input queue read, the framework of this model as shown in Figure 2 a, wherein, Client clientEnd enters data into Worker, and notifies that Master starts working, and then waits that Master completes work, and from WorkerExtraction process terminate after data.Master receives the initiation message that Client client sends, and continuous iteration is not until enlivening(active) node is operated that (the Worker node first starting all active during this is operated, and waitsAll Worker update the quantity of the Worker of active after completing work), iteration notifies that Client completes task after completing.Worker is arranged to active state after the data receiving Client input, and then continuous iteration is until being inactive shapeState (first waits the initiation message that Master sends, then reads message from In-Q, and carry out Message Processing etc. during thisWork, and send message, and to whether being that active state is updated, notify that when iteration completes Master completes this and takes turnsIteration works), wherein, when there being message to be sent to Worker, Worker is arranged to active state.
BSP structure is not only a kind of architectural model, is also a kind of method of design concurrent program.BSP programming criterionBeing Integral synchronous (bulk synchrony), it is unique in that the introducing of superledge (super step) concept.One BSP program is sameTime there is the structure of two aspects of horizontal and vertical.From vertical, as shown in Figure 2 b, a BSP program is by a series of stringsSuperledge (super step) composition of row, this is similar to that a serial program structure.From level, in each superledge,All of task parallelism performs local calculation.
As shown in Figure 2 c, each superledge can be divided into the three below stage.
1) the local computing stage, the data in each processor only internal memory local to storage carry out local computing.
2) the global communication stage, any non-local data is operated (interactive operation).
3) fence synchronous phase, waits the end of all communication behaviors.
Thus, by the executed in parallel local calculation strategy in superledge respectively to the task in step each in S2-S6 atReason, repeats through successive ignition, the execution time that can be substantially reduced, it is achieved the time complexity of minute rank, and can be significantlyThe load capacity of the amount of transmitted information during increase execution such that it is able to the task in the data volume of 1,000,000,000 ranks that realizes processes.
Wherein, presetting iterations PN can be: PN=n*M, wherein, M is the quantity on limit in original graph structure, and n is the most wholeNumber.Experiment proves that, the graph structure generated when n is 100 is fully random.
Wherein, S2, selecting M seed node among N number of node, in M seed node, each node is chosen respectivelyQ bar goes out limit and generates Q bar first and go out side information, and sends Q respectively to any Q in addition to self other nodes respectivelyBar first goes out side information, and Q bar goes out limit locking.
In an embodiment of the application, when control device selects M seed node among N number of node, specifically useIn: N number of node will have the node on limit as seed node, and specifically for controlling M seed node by followingFormula is chosen Q bar and is gone out limit:
Q=ceil (| Out (i) |/2) (1)
Wherein, what | Out (i) | was node i goes out limit quantity, and ceil () is the function that rounds up.
More specifically, step S2 can be realized by the superledge 0 in BSP structure, i.e. super step=0.
As super step=0, for each node in N number of node of original graph structure, if it exists limit, then may be usedUsing this node as seed node.Limit, and root is gone out from Q=ceil (| Out (i) |/2) bar that goes out to randomly select limit of each seed nodeGo out limit generation one first according to every and go out side information.Then Q bar first goes out side information be respectively sent to except first goes out limit letterBreath sends Q node outside node, that randomly select.Wherein, first go out side information include limit corresponding send nodeAnd peripheral node, be represented by [srcVertexId1, destVertexId1], wherein, srcVertexId1 be limit corresponding send jointPoint ID (Identity, identity), destVertexId1 is the peripheral node ID that limit is corresponding.
In embodiments herein, when inputting original graph structure, the original state on the limit in original graph structure is arranged to notThe value of lock-out state, i.e. limit is set to 0.When M seed node selects Q bar limit, and to except any Q of self fingerprintAfter other nodes individual occur Q bar first to go out side information respectively, the Q bar chosen can go out limit locking, the Q bar that will choose goes outThe value on limit is set to 1.
For example, for the prototype structure figure as shown in Figure 3 a inputted, there are 8 nodes, be respectively1,2,3,4,5,6,7,8, and 6 limits as shown in Figure 3 a.Wherein, node Isosorbide-5-Nitrae, 5,7,8 have limit, therefore, and node Isosorbide-5-Nitrae, 5,7,8Can be chosen for seed node, its quantity going out limit is respectively 1,1,1,1,2.Can obtain according to formula (1): node 1,4,5,7,8 canThe limit quantity that goes out selected is respectively 1,1,1,1,1.Then, as shown in Figure 3 b, illustrate as a example by node 8 and node 5,Limit can select one go out limit 8-> 5 from going out of node 8 at random, and generate this and go out the first of limit and go out side information [8,5] (dash-dotted gray lineRepresent transmission process), and send to any one node (such as sending to node 4) in addition to node 8, and by this 8-> 5The value on limit is set to 1, locks.Also limit can select one go out limit 5-> 2 from going out of node 5 at random, and generate this and go out limitFirst go out side information [5,2], and send to any one node (such as sending to node 6) in addition to node 5, and willThe value on this 5-> 2 limit is set to 1, locks.Wherein, locked limit grey filled lines represents.
S3, N number of node receive first go out the node of side information and go out side information according to receive first and judge whether to meet pre-If condition, as pre-conditioned in met, then from self selecting any bar go out limit and generate second and go out side information, and go out limit by secondInformation feeds back to send the first node going out side information.
In an embodiment of the application, control device 20 and receive the first node going out side information in controlling N number of nodeAccording to first go out side information judge whether to meet pre-conditioned time, specifically for: N number of node receives first and goes out side informationNode judges whether self has limit;If receiving the first node going out side information there is limit, then determine whether firstGo out whether the peripheral node in side information exists in limit or from as the first peripheral node going out in side information in going out of self;AndIn going out of self if first goes out peripheral node in side information limit does not exists and self it is not the first terminal going out in side informationNode (destVertexId1 is not equal to 4), then judgement meets pre-conditioned.
More specifically, step S3 can be realized by the superledge 1 in BSP structure, i.e. super step=1.
As super step=1, for each node in original graph structure, this super step=1 safeguards a List,For deposit this node all of go out limit, the most i.e. useListIt is called for short.If a node receives first and goes out side information, and shouldThere is limit in node, then judges that receive first goes out the destVertexId1 in side information [srcVertexId1, destVertexId1]Whether it is equal to this node ID at go out existence or the destVertexId1 in limit of this node.If destVertexId1 is at this nodeGo out in limit and do not exist, and destVertexId1 is not equal to the ID of this node, then sentence and meet condition, and select at random from ListTake a limit (the peripheral node ID on this unidirectional limit is destVertexId2), and (send to the node that ID is srcVertexId1First goes out sending of side information) transmission second goes out side information.
Wherein, second go out side information can include receiving first go out the node of side information from self select go out limit corresponding send jointPoint and peripheral node and first go out peripheral node included in side information, are represented by: [srcVertexId2,DestVertexId2, destVertexId1], wherein, srcVertexId2 is to receive the first node going out side information to select from selfGo out limit corresponding send node, destVertexId2 be receive first go out the node of side information from self select to go out limit correspondingPeripheral node, destVertexId1 is first to go out in side information included peripheral node.
For example, what Fig. 3 b interior joint 4 received that node 8 sends first goes out side information [8,5], and node 6 receives node 5First sent goes out side information [5,2], then node 4 and 6 judges whether self has limit respectively.Owing to node 6 does not go out limit,Then node 6 is unsatisfactory for pre-conditioned, and the conversion process of node 6 correspondence terminates.And node 4 has one to go out limit 4-> 3, and node4 receive first go out side information [8,5] send node not in this goes out limit 4-> 3, and node 4 is not first to go out side informationThe peripheral node of [8,5], therefore, node 4 meets pre-conditioned.
And then, as shown in Figure 3 c, randomly choose one of node 4 and go out limit 4-> 3, and generate second and go out side information [4,3,5],And what the node 4 receives first node 8 when going out side information sent, therefore, node 4 feeds back second to node 8 and goes out side information[4,3,5]。
S4, N number of node receive the second node going out side information go out side information according to second and generate the first exchange instruction and secondExchange instruction, and the second exchange instruction is sent to sending the second node going out side information.
In one embodiment of the invention, control device 20 and receive the second node going out side information in controlling N number of nodeAccording to second go out side information generate the first exchange instruction and the second exchange instruction time, specifically for: N number of node receives secondGo out the going out whether to exist in limit and receive first and go out the node of side information and go out limit from what self selected of node inspection self of side informationCorresponding peripheral node or from going out the node of side information and go out, from self select, the peripheral node that limit is corresponding as receiving first;WithAnd if receiving first and go out the node of side information and do not exist and self is not for connecing from peripheral node corresponding to limit that go out self selectedReceive described first and go out the node of side information from the peripheral node that limit is corresponding that goes out self selected, then generate the first exchange instruction andTwo exchange instructions.
Wherein, the first exchange instruction and the second exchange instruction are changed sides for control, will the limit that go out of two nodes swap, byThis, although the limit of the network of generation there occurs change, but the out-degree of each node is still consistent with artwork structure with in-degree.Specifically, step S4 can be realized by the superledge 2 in BSP structure, i.e. super step=2.
As super step=2, for each node in original graph structure, if node srcVertexId1 receives feedbackSecond goes out side information for [srcVertexId2, destVertexId2, destVertexId1], then node srcVertexId1 checks that it goes out limitIn whether there is destVertexId2 node, and check whether node srcVertexId2 is destVertexId2 node, if nodeSrcVertexId1 go out limit does not exist destVertexId2 node and node srcVertexId2 and destVertexId2 node is notSame node, then start to exchange limit, it may be assumed that transmits the first exchange instruction [-, destVertexId1] and [+, destVertexId2] to nodeSrcVertexId1 (will the first exchange instruction be sent to oneself), and by the second exchange instruction [-, destVertexId2] and[+, destVertexId1] send to node srcVertexId2 (sending the second node going out side information).
For example, for shown in Fig. 3 c when node 8 receive second go out side information [4,3,5] time, node 8 checks node 8Go out whether limit exists and go out peripheral node corresponding to limit (i.e. going out the peripheral node 3 of limit 4-> 3) selected by node 4, due toThe limit that goes out of 8 is 8-> 6 and 8-> 5, there is not node 3, and node 4 is not same node with node 3, therefore, such as figureShown in 3d, the first exchange instruction [-, 5] and [+, 3] can be generated, and send to node 8, and generate the second exchange instruction [-, 3] and[+, 5], and send to node 4.
The node that S5, reception second go out side information performs the first exchange instruction, and the node receiving the second exchange instruction performs secondExchange instruction.
More specifically, step S5 can be realized by the superledge 3 in BSP structure, i.e. super step=3.
As super step=3, receive the second node (namely generating the node of the first exchange instruction) going out side information and performFirst exchange instruction, the node receiving the second exchange instruction performs the second exchange instruction.
For example, as shown in Figure 3 e, node 8 performs the first exchange instruction [-, 5] of oneself generating and [+, 3], i.e. deletes 8-> 5This edge adds 8-> 3 this edge simultaneously;Node 4 have received the second exchange instruction [-, 3] and [+, 5], then delete 4-> 3 this edgeAdd 4-> 5 this edge simultaneously.
S6, all nodes are gone out limit it is unlocked.
More specifically, step S6 can be realized by the superledge 4 in BSP structure, i.e. super step=4.
As super step=4, for each node, the value being gone out limit is set to 0, i.e. unlocks.For example, such as Fig. 3 fShown in, the value of the 5-of node 5 > 2 this edge is reseted and 0 is not unlocked (being become the black in Fig. 3 f from the Lycoperdon polymorphum Vitt in Fig. 3 e).
The random map generalization system of the embodiment of the present application, by arbitrarily selecting two limits from original graph structure, and ties in original graphThe node that sends that there is not Article 1 limit in structure sends node and second to the limit of the end node on Article 2 limit and Article 1 limitWhen the end node on bar limit is not same node, will Article 1 limit and Article 2 edge contract, and add sending by Article 1 limitNode to the limit of the end node on Article 2 limit and is sent the node limit to the end node on Article 1 limit, with right by Article 2 limitOriginal graph structure is changed sides, the process on final election limit of laying equal stress on-change sides, until performing to preset iterations, it is possible to obtain withOriginal graph structure node number, limit number are consistent, and the Random Graph that the out-degree of each node is the most consistent with in-degree.
Additionally, in each repetitive process select the task in limit-change sides all can executed in parallel, greatly reduce the execution time,After successive ignition, time complexity is also only a minute level.And parallel processing can be greatly increased the information during execution and passThe load capacity of the amount of passing such that it is able to the task in the data volume of 1,000,000,000 ranks that realizes processes.Relative to traditional Random Graph generation sideMethod, greatly reduces the storage capacity of time complexity and graph structure, and the Random Graph of big data quantity graph structure of being more convenient for generates.
Any process described otherwise above or method describe and are construed as in flow chart or at this, represent include one orThe module of code, fragment or the part of the executable instruction of the more steps for realizing specific logical function or process, andThe scope of the preferred implementation of the application includes other realization, wherein can not be by order that is shown or that discuss, including rootAccording to involved function by basic mode simultaneously or in the opposite order, performing function, this should be by embodiments herein instituteBelong to those skilled in the art to be understood.
Represent in flow charts or the logic described otherwise above at this and/or step, for example, it is possible to be considered as realityThe sequencing list of the executable instruction of existing logic function, may be embodied in any computer-readable medium, holds for instructionRow system, device or equipment (system such as computer based system, including processor or other can from instruction execution system,Device or equipment instruction fetch also perform the system of instruction) use, or combine these instruction execution systems, device or equipment and use.For the purpose of this specification, " computer-readable medium " can be any can comprise, store, communicate, propagate or transmission procedure withFor instruction execution system, device or equipment or combine these instruction execution systems, device or equipment and device.ComputerThe more specifically example (non-exhaustive list) of computer-readable recording medium includes following: have the electrical connection section (electricity of one or more wiringSub-device), portable computer diskette box (magnetic device), random access memory (RAM), read only memory (ROM),Erasable edit read only memory (EPROM or flash memory), fiber device, and the read-only storage of portable optic diskDevice (CDROM).It addition, computer-readable medium can even is that and can print the paper of described program thereon or other are suitableMedium, because then can carry out editing, interpreting or if desired with it such as by paper or other media are carried out optical scanningHis suitable method is processed to electronically obtain described program, is then stored in computer storage.
Should be appreciated that each several part of the application can realize by hardware, software, firmware or combinations thereof.In above-mentioned enforcementIn mode, multiple steps or method can be with storing the software or firmware that in memory and be performed by suitable instruction execution systemRealize.Such as, if realized with hardware, with the most the same, available following technology well known in the artIn any one or their combination realize: have and patrol for the discrete of logic gates that data signal is realized logic functionCollect circuit, there is the special IC of suitable combination logic gate circuit, programmable gate array (PGA), field-programmableGate array (FPGA) etc..
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is canCompleting instructing relevant hardware by program, described program can be stored in a kind of computer-readable recording medium, shouldProgram upon execution, including one or a combination set of the step of embodiment of the method.
Additionally, each functional unit in each embodiment of the application can be integrated in a processing module, it is also possible to be eachUnit is individually physically present, it is also possible to two or more unit are integrated in a module.Above-mentioned integrated module is the most permissibleThe form using hardware realizes, it would however also be possible to employ the form of software function module realizes.If described integrated module is with software meritCan the form of module realize and as independent production marketing or when using, it is also possible to be stored in the storage of embodied on computer readable and be situated betweenIn matter.
Storage medium mentioned above can be read only memory, disk or CD etc..
In the description of this specification, reference term " embodiment ", " some embodiments ", " example ", " concrete example ",Or specific features, structure, material or the feature that the description of " some examples " etc. means to combine this embodiment or example describes comprisesIn at least one embodiment or example of the application.In this manual, the schematic representation to above-mentioned term not necessarily refers toIt is identical embodiment or example.And, the specific features of description, structure, material or feature can at any one orMultiple embodiments or example combine in an appropriate manner.
While there has been shown and described that embodiments herein, it will be understood by those skilled in the art that: without departing from thisThese embodiments can be carried out multiple change in the case of the principle of application and objective, revise, replace and modification, the application'sScope is limited by claim and equivalent thereof.

Claims (12)

CN201510115386.5A2015-03-172015-03-17Method and system for generating random graphPendingCN106033342A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510115386.5ACN106033342A (en)2015-03-172015-03-17Method and system for generating random graph

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510115386.5ACN106033342A (en)2015-03-172015-03-17Method and system for generating random graph

Publications (1)

Publication NumberPublication Date
CN106033342Atrue CN106033342A (en)2016-10-19

Family

ID=57150234

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510115386.5APendingCN106033342A (en)2015-03-172015-03-17Method and system for generating random graph

Country Status (1)

CountryLink
CN (1)CN106033342A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107153525A (en)*2017-03-232017-09-12北京空间飞行器总体设计部Satellite command sequence generating method based on flexible cum rights Directed Graph Model
CN109710314A (en)*2018-12-202019-05-03四川新网银行股份有限公司A method of based on graph structure distributed parallel mode construction figure

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6687363B1 (en)*2000-03-032004-02-03Lucent Technologies Inc.Method of designing signaling networks for internet telephony
US6728205B1 (en)*1997-02-192004-04-27Massachusetts Institute Of TechnologyMethod and apparatus for automatic protection switching
CN1558350A (en)*2004-01-142004-12-29清华大学 4- O(nlogn) Steiner tree method under geometric structure
CN102279874A (en)*2010-06-142011-12-14微软公司Fast edge routing for interactive diagramming
CN104335161A (en)*2012-06-182015-02-04国际商业机器公司Efficient evaluation of network robustness with a graph

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6728205B1 (en)*1997-02-192004-04-27Massachusetts Institute Of TechnologyMethod and apparatus for automatic protection switching
US6687363B1 (en)*2000-03-032004-02-03Lucent Technologies Inc.Method of designing signaling networks for internet telephony
CN1558350A (en)*2004-01-142004-12-29清华大学 4- O(nlogn) Steiner tree method under geometric structure
CN102279874A (en)*2010-06-142011-12-14微软公司Fast edge routing for interactive diagramming
CN104335161A (en)*2012-06-182015-02-04国际商业机器公司Efficient evaluation of network robustness with a graph

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107153525A (en)*2017-03-232017-09-12北京空间飞行器总体设计部Satellite command sequence generating method based on flexible cum rights Directed Graph Model
CN107153525B (en)*2017-03-232020-06-05北京空间飞行器总体设计部 Satellite command sequence generation method based on flexible weighted directed graph model
CN109710314A (en)*2018-12-202019-05-03四川新网银行股份有限公司A method of based on graph structure distributed parallel mode construction figure

Similar Documents

PublicationPublication DateTitle
Nie et al.A GEP-based reactive scheduling policies constructing approach for dynamic flexible job shop scheduling problem with job release dates
Glover et al.The simplex SON algorithm for LP/embedded network problems
Li et al.An effective hybrid algorithm for integrated process planning and scheduling
Ashuri et al.Fuzzy enabled hybrid genetic algorithm–particle swarm optimization approach to solve TCRO problems in construction project planning
Rego et al.A filter-and-fan approach to the job shop scheduling problem
Khandai et al.A novel approach of test case generation for concurrent systems using UML Sequence Diagram
Gacias et al.Parallel machine scheduling with precedence constraints and setup times
Wang et al.A graph-based ant colony optimization approach for integrated process planning and scheduling
Zheng et al.Improving the efficiency of multi-objective evolutionary algorithms through decomposition: An application to water distribution network design
Levitin et al.Optimal connecting elements allocation in linear consecutively-connected systems with phased mission and common cause failures
Przewozniczek et al.On turning black-into dark gray-optimization with the direct empirical linkage discovery and partition crossover
Harrison et al.Multi-period project selection and scheduling for defence capability-based planning
Sun et al.Effective job shop scheduling through active chain manipulation
CN106033342A (en)Method and system for generating random graph
SauerMarking optimization of weighted marked graphs
Dabah et al.AN EFFICIENT TABU SEARCH NEIGHBORHOOD BASED ON RECONSTRUCTION STRATEGY TO SOLVE THE BLOCKING JOB SHOP SCHEDULING PROBLEM.
Kennington et al.The uncapacitated time-space fixed-charge network flow problem: an empirical investigation of procedures for arc capacity assignment
Baioletti et al.An experimental comparison of algebraic differential evolution using different generating sets
Zuo et al.Two heads are better than one: an AIS-and TS-based hybrid strategy for job shop scheduling problems
de Oliveira et al.A multi-start simulated annealing algorithm for the vehicle routing problem with time windows
Rego et al.Ejection chain and filter-and-fan methods in combinatorial optimization
CN106155978A (en)The construction method of reconfigurable system and device
Amaya et al.Hybrid cooperation models for the tool switching problem
Ji et al.A variable neighborhood search algorithm for human resource selection and optimization problem in the home appliance manufacturing industry
Jaramillo et al.Metaheuristics for the integrated machine allocation and layout problem

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20161019


[8]ページ先頭

©2009-2025 Movatter.jp