Background technology
Urban public tranlport system is one of very important infrastructure in city, is the essential tool maintaining Urban Reasonable running.Current China is in the fast-developing phase, first develops urban transportation, carries out rational traffic programme, and Traffic Development can be made to adapt to future city volume demand.This wherein, urban public transport in the trip carrying most of crowd in city, so optimize and improve city public transport interchange system, to alleviation urban congestion and improve passenger trip have vital effect.
Traditionally, the planning of urban public transport is according to the wagon flow on statistics urban road, the stream of people according to certain traffic design method establishment.At present, scholar both domestic and external starts to rise and uses the method for network to study Traffic Systems, ites is desirable to find out some key property of traffic system and optimal design urban transportation accordingly by this kind of research.Correlative study has had a lot of theoretical results.Abroad, the example of correlative study: Sienkiewicz and Holyst have studied the topological property of the public traffic network in Poland 22 cities, finds that the public traffic network in all these cities all has obvious small world and hierarchically organized characteristic; Seaton and Hackett utilizes network theory knowledge to calculate the average path length of two city train gauzes, the cluster coefficients of average node degree equally, and confirms the impact of network structure for small world by comparative studies each other.At home: Yang Xuhua etc. have studied the topological property of public traffic network in Beijing, three cities in Shanghai and Hangzhou, and by proposing relevant optimization method to the comparative study of these three Urban Transit Networks; Huanghai Sea army, Gao Ziyou, Wu Jianjun etc. by having carried out a lot of research to Traffic Systems network facet, also deliver some to optimize about the traffic flow research of network about city bus, road on works.
Public Transport Transfer is the representative instance using network theory research urban transportation.People can regard bus station as network node, the contact produced are regarded as and connect limit, abstractly obtain a figure between website by bus, then use ripe dijkstra's algorithm or Floyd algorithm to get final product the transfer plan that computing obtains performance.But there is a lot of deficiencies in these class methods.First: they do not consider extensively to be present in simultaneously again for the closely website pair that Public Transport Transfer plays an important role in actual public transit system, and so-called closely website is to namely directly arriving website pair by short distance walking each other.In the process of Public Transport Transfer in reality transfer process, people walk to a certain adjacent bus station from a certain station row sometimes, and then change to.Traditional transfer method does not consider this factor.Secondly, they only provide the transfer plan of the single result of single standard performance index, at this moment because the feature of dijkstra's algorithm and Floyd algorithm itself causes.Finally, their working time is comparatively slow, and computing redundance is comparatively large, and the time complexity that the single due to traditional algorithm is inquired about is close to O (n
2), wherein n is the node number in network, so for catenet, just there will be inquiry longer deficiency of corresponding time.
Summary of the invention
Do not consider closely walking transfer, the deficiency that the speed of response is poor, real-time is poor to overcome existing city bus transfer algorithm, the present invention proposes a kind of to consider in public transit system between bus station by public bus network and by closely walking accessibility produce contact, the consideration parametrization Public Transport Transfer method that closely walking website is right that fast response time, real-time are good.
The present invention solves the technology concrete steps that its technical matters adopts:
Consider the parametrization Public Transport Transfer method that closely walking website is right, comprise the following steps:
Step one: the function to indicate weight parameter calculating Public Transport Transfer is set: public transport weight P1 (x1), walking weight P2 (x2) and transfer weight P3 (x3), representative use passenger to use bus to move ahead in bus trip cost that x1 physical distance needs to pay, walking move ahead cost that x2 physical distance needs to pay and take x3 and plow the cost that bus needs to pay respectively, arrange the optimum transfer plan number TN of reservation simultaneously;
Step 2: the oriented passenger transfer network T of weighting building city bus, a node in T-network corresponds to website that a website T-network record in public transit system can be arrived by a public bus network to information, exists to connect limit and if only if to there is at least one public bus network that can go directly between these two websites in T-network between any two websites; Owing to sometimes arriving by many circuits between website pair, so many even limits may be there are between T-network from a website to another website, every bar connects limit and represents a circuit that can go directly to arrival website follow website, and the weights connecting limit are the physical distances of these two websites by this circuit process;
Step 3: the weighting oriented walking network W building city bus, the bus station that W Network records can be arrived by short distance walking is to information, a node in this W network corresponds to a website in public transit system equally, exist between any two websites in W network and connect that and if only if on limit these two internodal physics walking distances are less than a threshold value Γ, the weights on this limit are also defined as physics walking distance;
Step 4: apply above-mentioned T-network and W network, travel through each website, application is a kind of improves breadth-first search, and calculates according to the cost function defined by the function to indicate weight parameter P1 (x1) arranged, P2 (x2), P3 (x3) and the final transfer plan number TN retained the transfer plan arriving other websites from this traversal website;
The detailed process improving BFS (Breadth First Search) method is as follows:
4.1) array that comprises the several element in bus station is built, in defining arrays, each element comprises following information: site number and one store the scheme set of transfer plan, and the every bar information wherein in this set illustrates follow website S and arrives the less transfer plan of a kind of cost of this website; It is which kind of scheme arrived in which website of this website by slave site S arrives the essential information of this website and the cost of this transfer bill through which bar circuit that every bar information have recorded this transfer plan, in the scheme set of each website, there is Least-cost and the maximum more excellent transfer plan of cost, they are registered as MAXC and MINC respectively;
4.2). build a class tree and be used for traversal, in definition class tree, each node comprises following information: the corresponding site number of node serial number, node, father node numbering, set Current Layer as ground floor, described ground floor only comprises root node corresponding to the website that sets out;
4.3). all nodes of traversal current layer, for traversing website A corresponding to node, travel through its all neighbor site in T-network and W network; For the website B traversed arbitrarily, if the MINC of the scheme set of website S to website A is less than the MAXC of the scheme set of website S to website B, so just travel through the scheme set of website A further;
In this traversal, use the candidate transfer plan being generated some slave site S to website B by a certain more excellent transfer plan of the slave site S of correspondence to website A again by walking or public bus network to the transfer plan of website B; If these schemes do not comprise repetition website simultaneously cost be less than again the MAXC of the transfer set of website B, so just scheme is added the transfer set of website B, upgrade MINC and MAXC of website B simultaneously, and add a child node to the current traverse node of class tree further, child node corresponds to website B;
4.4). arranging tree traversal current layer is the sublayer of this layer, if current layer is not empty, then repeats step 3), otherwise carry out next step;
4.5). intercept the transfer plan transfer set of each website, retain at most TN kind transfer plan before the trip Least-cost follow website S to other websites arbitrarily.
As preferred a kind of scheme, in described step 4, by the transfer plan that obtains stored in database.
Described parametrization Public Transport Transfer method is further comprising the steps of:
Step 5: for any given start site and object website, search the transfer plan between them in a database, and transfer plan is returned to user.
Further, in described step 4, described cost function is expressed as:
C
ij=P1(x1)+P2(x2)+P3(x3)
Wherein, C
ijfor cost.
Beneficial effect of the present invention is: to consider in public transit system between bus station by public bus network with produced by closely walking accessibility contact, fast response time, real-time be good.
Embodiment
Below in conjunction with accompanying drawing, the present invention will be further described.
With reference to Fig. 1, a kind of consideration parametrization Public Transport Transfer method that closely walking website is right, comprises the following steps:
Step one: the function to indicate weight parameter calculating Public Transport Transfer is set: public transport weight P1 (x1), walking weight P2 (x2) and transfer weight P3 (x3), representative use passenger to use bus to move ahead in bus trip cost that x1 physical distance needs to pay, walking move ahead cost that x2 physical distance needs to pay and take x3 and plow the cost that bus needs to pay respectively, arrange the optimum transfer plan number TN of reservation simultaneously;
Step 2: the oriented passenger transfer network T of weighting building city bus, a node in T-network corresponds to a website in public transit system, the website that T-network record can be arrived by public bus network, to information, exists between any two websites to connect limit and if only and if there is at least one public bus network that can go directly between these two websites in T-network; Owing to sometimes arriving by many circuits between website pair, so many even limits may be there are between T-network from a website to another website, every bar connects limit and represents a circuit that can go directly to arrival website follow website, and the weights connecting limit are the physical distances of these two websites by this circuit process;
Step 3: the weighting oriented walking network W building city bus, the bus station that W Network records can be arrived by short distance walking is to information, a node in this W network corresponds to a website in public transit system equally, exist between any two websites in W network and connect that and if only if on limit these two internodal physics walking distances are less than a threshold value Γ, the weights on this limit are also defined as physics walking distance;
Step 4: apply above-mentioned T-network and W network, travel through each website, application is a kind of improves breadth-first search, and calculates according to the cost function defined by the function to indicate weight parameter P1 (x1) arranged, P2 (x2), P3 (x3) and the final transfer plan number TN retained the transfer plan arriving other websites from this traversal website;
The detailed process improving BFS (Breadth First Search) method is as follows:
4.1) array that comprises the several element in bus station is built, in defining arrays, each element comprises following information: site number and one store the scheme set of transfer plan, and the every bar information wherein in this set illustrates follow website S and arrives the less transfer plan of a kind of cost of this website; It is which kind of scheme arrived in which website of this website by slave site S arrives the essential information of this website and the cost of this transfer bill through which bar circuit that every bar information have recorded this transfer plan, in the scheme set of each website, there is Least-cost and the maximum more excellent transfer plan of cost, they are registered as MAXC and MINC respectively;
4.2). build a class tree and be used for traversal, in definition class tree, each node comprises following information: the corresponding site number of node serial number, node, father node numbering, set Current Layer as ground floor, described ground floor only comprises root node corresponding to the website that sets out;
4.3). all nodes of traversal current layer, for traversing website A corresponding to node, travel through its all neighbor site in T-network and W network; For the website B traversed arbitrarily, if the MINC of the scheme set of website S to website A is less than the MAXC of the scheme set of website S to website B, so just travel through the scheme set of website A further;
In this traversal, use the candidate transfer plan being generated some slave site S to website B by a certain more excellent transfer plan of the slave site S of correspondence to website A again by walking or public bus network to the transfer plan of website B; If these schemes do not comprise repetition website simultaneously cost be less than again the MAXC of the transfer set of website B, so just scheme is added the transfer set of website B, upgrade MINC and MAXC of website B simultaneously, and add a child node to the current traverse node of class tree further, child node corresponds to website B;
4.4). arranging tree traversal current layer is the sublayer of this layer, if current layer is not empty, then repeats step 3), otherwise carry out next step;
4.5). intercept the transfer plan transfer set of each website, retain at most TN kind transfer plan before the trip Least-cost follow website S to other websites arbitrarily.
As preferred a kind of scheme, in described step 4, by the transfer plan that obtains stored in database;
Described parametrization Public Transport Transfer method is further comprising the steps of:
Step 5: for any given start site and object website, search the transfer plan between them in a database, and transfer plan is returned to user.
Further, in described step 4, described cost function is expressed as:
C
ij=P1(x1)+P2(x2)+P3(x3)
Wherein, C
ijfor cost.
In the present embodiment, network model is used to calculate Public Transport Transfer.The network that 2 kinds characterize public transit system is contained: T-network and W network in network model.T-network have recorded the website that can be arrived by public bus network to information, and the website that W Network records can be arrived by short distance walking is to information.These two kinds of networks complement each other, and more intactly embody the essential information that public transit system relates to transfer, transfer algorithm is overcome in traditional algorithm and does not consider the shortcoming that closely walking is changed to.
Moreover, define function to indicate weight parameter: public transport weight P1 (x1), walking weight P2 (x2) and transfer weight P3 (x3), be used for describe from a website to another website process path transfer cost size and convenient degree.Slave site i is set out and arrives a kind of transfer plan of website j, if the program walk that path relate to the bus travel of x1 physical distance, the bus of the walking route different from x3 time of x2 physical distance takes i.e. (x3-1) secondary transfer, so the cost C of this transfer plan
ijjust can be expressed as following form:
C
ij=P1(x1)+P2(x2)+P3(x3)
The object calculating transfer plan algorithm in method be just to locate any website i set out arrive any website j all transfer plans in C
ijbe worth minimum TN kind transfer plan, namely find the multiple more excellent transfer plan for specific agility index.In actual application, method can make transfer algorithm have good dirigibility by the function of adjustment P1 (x1), P2 (x2) and P3 (x3), such as adjustment makes the importance of P2 (x2) increase, and as far as possible the transfer plan so obtained considers the transfer plan that walking distance is short; Adjustment makes the importance of P1 (x1) and P2 (x2) increase, and as far as possible the transfer plan so obtained considers the transfer plan that path distance is short; Adjustment makes the importance of P3 (x3) increase, and as far as possible the transfer plan so obtained considers the transfer plan that number of transfer is few.
Devise a kind of improvement breadth-first search (MBFSA).MBFSA calculates according to the cost function defined by the P1 pre-set (x1), P2 (x2), P3 (x3) and the transfer plan number TN finally retained the more excellent transfer plan arriving other websites from 's website.
To have employed the transfer plan calculated stored in the method for database to shorten user's query responding time.As everyone knows, in algorithm research process, optimize the while of being in most cases and can not ensureing time complexity and space complexity simultaneously, if namely require that the sequential operation time is short, program is so often needed to take a large amount of storage space, if and require that program takies less storage space, so often need again sacrifice arithmetic speed.From the angle of user, they need the bus change search system of fast response, so this transfer method choice database technology, pre-computation are obtained the scheme of the transfer plan between all websites pair stored in database.Such user does not just need computing machine to carry out relatively slow calculating transfer computing when inquiring about, and directly obtains result fast by Query Database.This scheme also greatly reduces the computing redundancy of pre-computation process simultaneously.
Composition graphs 1 illustrates the process of the MBFSA algorithm in the present embodiment: the left subgraph of Fig. 1 shows example public traffic network slave site 1 and to set out the ergodic classes tree obtained according to algorithm, and wherein every bar connects text importing on limit from a website to the concrete mode of another website and cost; The right subgraph of Fig. 1 show accordingly every one deck traversed after, the change of each website transfer plan set, wherein represents the scheme set that the text importing in the square frame of each website is concrete.
Specifically: algorithm first slave site 1 set out carry out MBFSA ground floor traversal, because slave site 1 is set out, can by taking 1 bus or walking directly arrives website 2, website 3 and website 4(such as, slave site 1 can by walking, take Line 1 or take No. 2 lines arrive websites 2), so their transfer plan set has been obtained renewal.Algorithm to carry out the traversal of second, third identical layer afterwards.It should be noted that algorithm only via last layer website a certain transfer plan, arrive website and the transfer plan that total cost is less than the MAXC of website scheme set adds the set of website scheme through a road state car (or directly walking) again.Such as, when the 2nd layer of traversal, suppose that slave site 4 can be taken a bus and arrive website 2, but because its cost is too large, so final algorithm has been abandoned via slave site 1 to website 4, the transfer plan arriving website 2 again adds the scheme set of website 2, in the ergodic classes tree of left subgraph, also just do not occurred connecting the company limit of website 4 and website 2 in third layer in the second layer simultaneously.
After the 3rd layer of traversal, there is not the 4th layer, so ergodic process terminates owing to upgrading rear ergodic classes tree.The relevant programme set of each website is just obtained after having traveled through.Every bar record in the scheme set of each website represents optimizes transfer plan from start site to the one of this website.Such as: the last item record of the scheme set of website 2 represents a slave site 1 and sets out and arrive website 3 by walking, then by total cost that No. 3 lines arrive websites 2 be the optimization transfer plan of 3.5.
In the end, algorithm has intercepted the transfer plan set of each website, only retains the front TN kind transfer plan of wherein Least-cost.Such as first in its scheme set and the 4th kind of transfer plan are only remained for website 5.
As mentioned above, the specific implementation step of this enforcement makes the present invention more clear.In the protection domain of spirit of the present invention and claim, any amendment make the present invention and change, all fall into protection scope of the present invention.