# Space gate traffic control problem

A civilization uses the sci-fi staple of space gates to get around between systems. These gates, for our purposes, are big, round and very much not transparent; think the star gates but huge or the gates in the X universe of games. You can't see though them, we will assume they have a frequency shadow some what like deep water.

The civilization has a huge range of ships, some tiny like cars and some colossal ships that only just fit through the gates. A system is doing really well, traffic is up a huge amount on last year, but there is a problem. The accident rate is also up.

How do you stop ships popping out of the gate directly in front of another ship, causing an accident? However, efficiency is very important. We don't want to limit the gates to one ship at a time in each direction. However, if one of the really big ships is coming through it is necessary to stop all craft from the other side. It is also important that ships keep a minimum safe distance between each other. When a ship enters it leaves in the same place on the other side. The ship has to be entirely inside the portal before it starts coming out the other side. Travel time is near instant once inside the portal. Ships enter and exit at the same speed.

Bear in mind that it is hard for the two halves of the gate to talk to each other, deep water is hard to transmit though (though not impossible). I would like to not break the Nyquist rate limit here. Some other method of communication between the sides is possible. I had a slightly crazy idea of using ping pong balls to signal a ships impending arrival while thinking about this.

Ships not following the proper protocol will be dealt with by law enforcement, for "Reckless endangerment of life in control of a ship" or some such law.

I'm looking for a system that provides the best bi-directional through put of ships and doesn't cause any one to sit in a queue for hours on either side of the gate.

• Many people have suggested splitting the gate in half, which is a good idea except for the massive ships that barely fit. In this case they suggested using pilot ships, etc. I propose using two portals; that way it is a constant flow in either direction, just like highways (not roads) in real life. – Towell Jun 12 '15 at 23:43
• This question is putting the following image into my head: Jack O'Neill is starting a new expedition, leads his team, start entering the Stargate and hit his head with the head of the person coming through in this moment. :-) – Mnementh Jun 13 '15 at 5:26
• Side note: the Honorverse has wormholes that function similarly with respect to traffic (although there's a bit of a throttle). They go into a bit of detail about some of the surrounding procedures. – Clockwork-Muse Jun 13 '15 at 6:01
• Just what sort of traffic flow are you envisioning? 1 per minute? 1 per second? 10 per second? 1 per second is 31 million per year. – WhatRoughBeast Jun 13 '15 at 13:23
• @evilsoup the object must entirely enter the portal before it comes out the other side. They are fixed point to point. No changing where they go. – Wil Selwood Jun 14 '15 at 12:10

Break the gate into sections. For example, with equal traffic you might have everyone going one way take the left half, everyone going the other way take the right half. If traffic is less equal, you could break this out unevenly - 75/25 or so on. Presumably this could be changed dynamically if there are traffic patterns. Note that "left" and "right" in this case would be arbitrarily defined by the traffic control system.

If traffic is heavy enough that it saturates gate traffic, a queue is unavoidable - you need some way to line people up and limit them from cutting in line.

Ships that are too big to fit through their directional section would need to temporarily stop traffic the other way. This should be accomplished through unmanned drones that pass back and forth through the gate to allow for communication, you could dedicate say, 1% of the gate area for this.

• I like this. Paired with a smart packing algorithm smaller ships could be picked out of the queue and allowed to go through with bigger ships to maximise use of the gates surface area. This would also give a good reason for smaller ships to be used, as they would get though busy gates quicker. – Wil Selwood Jun 15 '15 at 15:23

Use pilot ships.

Splitting the gate for bidirectional traffic is the trivial answer which should be done anyway. The problem comes from large ships which would take more than their lane.

Similar to large loads on our current highway systems, the large ships could use pilot ships, or escort ships to fly through the gate ahead of them and warn opposing traffic that a large ship is coming through the gate.

Pilot ships could be manned or unmanned drones launched from the larger ship. A large ship traveling in space will probably want a complement of smaller ships for many other such tasks in any case, such as crew transfer to station or planet and as a protection from attack.

How cool would it be if Earth semi-trucks launched little autonomous vehicles/drones to act as their escorts? Very. It follows that this applies to space ships as well.

Some scheduling wouldn't hurt either. Again pointing to Earth systems, the Panama Canal, which is arguably more difficult to manage the traffic on, has more traffic on it that ever imagined by its builders. This is, in part, thanks to the marine traffic control implemented there.

If the large ship traffic becomes too great so that people are waiting a long time to pass through. Well, either increase the gate size or set up retail and entertainment for people to enjoy while they wait and their ships autopilot through the queue. It takes 20-30 hours to get through the Panama Canal but it saves travellers a 7,000 mile journey around the horn.

Even waiting 20 days to get through a space gate which shaves 40 years off of the trip seems like an awesome deal.

The basic idea is that these are fairly general problems which we have, for the most part, solved on Earth. The solutions should generally apply to space based systems.

• Definitely take a look at the panama canal, like Samuel says. It is the equivalent of what you are doing sans time period. – PyRulez Jun 12 '15 at 21:57
• What happens when two big ships try to pass at the same time -- their pilot ships will jump first and stare right up to their counterparts subject/ward. How would you handle precedence rules? – hiergiltdiestfu Jun 15 '15 at 10:17
• In case that is an issue: yes, play PingPong! Send out two pilot-ships, leave one to secure your right of way, have the other come back to you, saying "this is secure". – Layna Jun 15 '15 at 13:41
• @hiergiltdiestfu As with on Earth, you can get most systems to fail if everyone involved is acting like an idiot. There are many ways to solve potential collision issues, whichever pilot ship rolls the highest value from an RNG seems like an acceptable protocol. – Samuel Jun 15 '15 at 14:31
• This is a really good answer for dealing with the big ships. I've accepted @DanSmolinske answer because he goes into more detail about the general case. – Wil Selwood Jun 15 '15 at 15:25

You are bending space, why is the 'in' and 'out' on the same side of the gate? Ships go in one side to the other gate and come out the other side from the other gate. Maximizes throughput.

So you can have an OUTGOIONG side and an INCOMING side. Makes dealing with traffic much simpler.

• I was just about to post that... :) – Frostfyre Jun 12 '15 at 18:39
• Let's say 10000 ships want to travel in one direction and 10 in the other at some time. The 10000 ships could use both sides of the gate to travel through more efficiently. However using your traffic rules half of the traffic capacity would be reserved for 10 ships. – fabian Jun 12 '15 at 18:53
• @fabian Well that is pretty much what happens in every city during rush hour, and switches directions between morning and evening. Only a few cities have a lane(s) that switch with the tides. – bowlturner Jun 12 '15 at 18:56
• Suddenly I don't know why troops don't pile through both sides of the star gate when invading some where. – Wil Selwood Jun 12 '15 at 19:51
• As always stack exchange has the answer: scifi.stackexchange.com/questions/39519/… – Wil Selwood Jun 12 '15 at 20:02

Messages may not travel well through the gates, but ships do, so use the ships to transmit the messages:

• a space station / satellite or something similar is placed on each side near the gate (or integrated in the gate, if possible). Those satellites contain computer systems for handling the traffic and communication systems to communicate with ships
• Every ship that crosses the gate is also required to communicate with the satellite to receive the coordinates and time of it's crossover. Ships also receive data they have to transmit to the satellite on the other side of the gate.
• The gate is devided into sections where small ships can travel through. On every section the ships are only allowed to travel through the gate in one direction. The satellites can reserve more sections, if they send appropriate messages through the gate. (depending on the content of the message the other satellite may need to send a acknowlegement)
• There are time intervals where only large ships are allowed to travel through and only in one direction. (But by sending messages other intervals can be requested and acknowleged)

This strategy has the following benefits:

• You do not need probes / messenger ships going through the gate
• Even large ships can travel through without requiring messages to be transmitted
• Traffic handling happens dynamically based on the current amount of traffic
• the more ships travel through the gate, the faster the communication between both sides becomes

If the satellites have a large enough communication range and communication is sufficitently faster than space travel (except for gates) the satellites should have enough time to take care for large traffic throughput.

The gate could use "token-ships", similar to token-ring networks.

• The system where the token-ship currently is, is allowed to send ships through the gateway.

(Close to a single endpoint of the gateway, interstellar traffic can be managed via regular radio communications; e.g. a trafic control "tower")

• When all ships from the system have departed through the gateway, the token-ship leaves to te next system.

This allows for gateway systems that connect more than two systems, but allow only one (or a few) ships to travel through them simulataneously.

This method works best when the travelling of the token-ship does not take too much time compared to the regular trafic.

This method of sharing a gateway system is preferrable to CSMA/CD given that ship crews do not prefer to die while "detecting a collision".

It can be combined with the other solutions:

• different parts of gateway for different directions; that would convert to multiple token-ships
• pilot ships: the pilot ship aproach uses one pilot-ship for every large ship and none for small ships, wheras the token ship method uses one token-ship for every group/time slot of ships both large and small.

How about a couple of these at either end:

This sounds no different than what happens if there's construction work going on one lane of a usually two-lane road. Since drivers in both directions now need to share the same lane, and the road is long or curved so they can't just look and wave at each other, they simply queue up and wait for a light to change.

In this case, ships are free to enter while the light's green, knowing that it's red to those waiting on the other side. Since travel time is almost nil, it's should easy set up such a system with synchronized - but independent - lights. The end result will be like waiting for a ferry that goes back and forth between two ports, unloading and loading.

If the lights' intervals need tweaking (due to heavier traffic in one direction), send a technician through the gate in a ship (the technician can skip to the front of the queue, but will have to wait for a green light), with instructions for how and when to configure the lights. Or simply put him/her on the next ship going through, if that's possible ("Sorry, cap'n, official business!").

Is there a risk that the lights will go out of sync or just fail? Yes. Same goes for road construction in the real world, and that hasn't kept people from driving (well, that's kinda the problem, I suppose).

Of course, you can have ping-pong balls as a backup semaphore system. You could even send them as good old morse code :)

Still, that presumes three things:

1. You can send them somewhere near the edge of the gate, so ships can still go through unimpeded.

2. That collisions inside the "tunnel" don't occur, for whatever reason. I'm certainly not a physicist, but if two objects are travelling toward each other at (in effect) super-luminal speeds, I'd assume something's going to happen if they collide. A ping-pong ball at sufficient speed will wreck anything.

3. The ping-pong balls aren't full of air. Vaccuum of space and all that.

I'm looking for a system that provides the best bi-directional through put of ships and doesn't cause any one to sit in a queue for hours on either side of the gate.

Yes, well, you and real-world traffic engineers. Unless you have simultaneous bidirectional travel, you will have some queuing, somewhere.

Image by KRoock74 from WikiMedia, CC share-alike

• Was about to suggest traffic lights. You just need to keep the clocks in sync – superluminary Jun 15 '15 at 9:26

Use the Agora system where the position in the traffic flow is something you have to bid on. Since this is a very limited resource, the amount being bid will be fairly significant, paying for upkeep, salaries and so on, but the key is there will be a "market" for the service, and the bidding will allow for the most efficient use of the resource.

Essentially the traffic control centre will announce "slots" up for auction and ships will bid for their slots. Traffic control maintains order by timing the slots and auctions for alternating times, so for a very slow gate the slots at the "top" and "bottom" of the hour go "East-West", while the slots at "quarter to" and "quarter past" go "West-East". We can compress this to whatever figure works with the speed of the ships and the ability of the Gate to clear traffic (you say the transit is instantaneous for the ship, but does the Gate itself need to be charged up between transits? That might be a sticking point).

Bidding for the resource ensures the high priority/high cost traffic goes through the fastest and clears the line, while the alternating "East-West/West-East" timing of the traffic slots ensures the gate is only handling traffic in one direction at a time, minimizing the possibility of accidents.

Expanding on your ping-pong idea, it might be possible to have a small observation shuttle on a magnetic rail attached to the gate structure. The shuttle would to back and forth from one side of the gate to the other, acting as a control tower for ships coming from either side. Using the rail, it could efficiently pass back and forth through the gate at a regular interval, fast enough to keep reasonable track of the approaching ships, and coordinate with their respective nav officers.

This traffic control pod could easily position the ships as they come, using the gate as a positional reference. One ship could be told that they're clear to approach in quadrant one of the gate's surface while a ship on the other end would be told to enter on quadrant four, giving the other ship plenty of clearance.

Why don't you just have one way gates inside something that looks like a big gate? Even if you put two of them side by side, it might look something like this:

>v^>  sector 1          | Sector 2        >v^>
v^                     |                  v^
v^                     |                  v^
[xY]   gate to sector 2 |                 [yX]


Where x/y are gates, <>v^ represent ship movement direction. The [] represent the gate as a whole object, imagine a circle with 2 inner circles side by side.

Notice the x and y configurations: small x is the input gate, and big X is the output gate corresponding to small x. Same goes for the y gates.

In order to lower wait times and prevent crashing when coming out of the other end, the only requirement is that any ship approaching the gate be at a constant speed XYZ, until they reach a certain marker on the exit route, at which point they must speed away, peeling to the right.

Upsides to this system:

• The average efficiency of the gates will be higher since you always have at least 2 ships using it.

• No more accidents! Or at least a much lower rate.

Downside to this system:

• You have to make your gates about 2x larger overall in order for the inner gates to accommodate your largest ships. This shouldn't be a problem though, as gravity is negligible in space.

Alternatively, if you're dead set on having exactly one gate, I would suggest putting in a "registration" system on the gate. You register at least 2 hours before going to the gate, and the system will give you a queue number. Numbers can be projected onto certain sections of the gate that correspond to which ships are allowed to use that section at that time. On top of just a number, perhaps add a circle-projection area around the number to designate exactly how much space he has to go through.

As soon as the ship goes through, his number is removed from the gate, and a new number is placed there. If the next ship is a large ship, numbers just don't get added to the gate until the big one comes through.

Next, have a bunch of drones flying around each gate that line themselves up to create "lanes" in space. Any ships exiting or entering must enter and exit through those lanes in order to prevent stupid piloting; eg: turning right right after you exit the gate and smashing into a battleship.

TL;DR? Let the computer system handle it. By having registration time, there will be enough time for the system to sync itself up across gates. Not only do you eliminate the risk of human error, you also allow the system to plan for maximum efficiency.

Hmm, a series of tiny (think size of a deck of playing cards) "probe" transmitters equipped with each ship. They go in first, say at the very edges, and announce the arrival of the incoming ship. If another probe is already there transmitting an arrival, it returns and tries again in 15 seconds. It scans the area and if clear, returns and signals the ok to proceed. At the destination, ship has 15 seconds to clear the indicated area before the next ship arrives. Any accidents are because someone wasn't following the probe telemetry.

Probes can also announce the incoming of caravans, or some amount of time or number of ships to wait before others use the gate.

• CSMA/CD without the casualties – Kasper van den Berg Jun 13 '15 at 12:17
• Which would be CSMA/CA :) – hiergiltdiestfu Jun 15 '15 at 10:22

A lot of good thinking is listed already for scheduling, layout and probes etc. Some thought on how to further improve:

1. Have a good and fail-safe emergency scheme. You are a target of pirates/terrorists/Murphy.
2. Make the busiest side of the gate the boss side, the other side facilitates. No mix-ups!
3. Use Elephant lines to maximise efficiency.

So you have a giant portal. If you can only enter one side of the portal, then split that portal up into two halves, one for outgoing and one for incoming ships. If a large vehicle has to go through, they should send 2 small probes through first. This probe stops traffic in the other direction and rotates the portal such that the exit is not about to crash into the traffic waiting in line. One of the probes goes back through, and reports to the large vehicle that it is safe to proceed. The large vehicle goes through and rotates the portal back to it's designated orientation. Traffic following the large vehicle waits until a ship comes through from the other direction (if no ships the large vehicle sends a drone back through as an indicator)

If you can't rely on the large ships doing so, a small manned operation on either side can handle the rotation of the portal so that the large ships don't crash into the line of ships waiting to go through.

Many people posted excellent answers on this already. However, I wanted to add a little story realism / flavor (amplifying the excellent answer provided by Samuel).

Let's assume the portal is giant and vessel sizes range from 1 manned flitters up to gargantuan colony ships which fill the entire portal face. To optimize use, you will want to set up unidirectional lanes (as Samuel and other's have said) but you also want "lanes" set up for the smallest common denominator (the small flitter). Split the portal into as many lanes as you can safely manage and allocate the unidirectional lanes according to the amount of traffic going in each direction.

Using a lane to transit represents 1 unit of charge (expense) for using the gate. A person flying a cruiser through the portal (which uses 4 lanes) will get charged 4x as much. A freighter that also uses 4 lanes but is slow so it takes twice the time, costs 8x as much as a small flitter lane.

How about gargantuan colony ships? They use all lanes and stop traffic going both ways for a considerable amount of time. This probably costs an arm and a leg to pay the transit costs.

Transit costs get paid to the transit authority that maintains all hardware, patrol ships, and pays the salary for the space traffic controllers on both sides of the gate.

Transit officers on each side send messages back and forth using radio drones informing the other side of impending changes in traffic pattern and the timing of those changes.

Wealthy travelers could pay a premium to get moved to the head of the queue to some extent. But if there's lots of traffic, the controllers would be unlikely to take increased toll payments for disrupting all the rest of the traffic.

Require the ships to follow a pre-approved flight plan detailing approximately where a plane will travel, including data on altitude. Any sudden deviation will have to be approved by a local traffic controller. Also, establish a traffic control post where the controllers can monitor the movements of the ships and reroute them if necessary.

In the Star Gate universe itself the answer is simplified by the fact that its Gates are unidirectional: if the Gate is already open and you didn't open it then it is most likely open in the wrong direction and you wait for it to close again (and stay out of the way of anything coming out). (Of course there are complications in the Star Gate universe, but that's the key gist of it.)

Certainly in any high-traffic section of gates the "easy" answer is that if you can get them/afford them you get two gates side by side each going the opposite direction, and focused on unidirectional travel. (Similar to how an interstate is effectively two unidirectional roads in parallel...)

Even if in your universe your gates are not unidirectional due to physical constraints as in Star Gate, you can simply color code and designate two side by side gates as "Out" and "In".

In the PC Space simulator Freelancer, they also use waygates, as well as wormholes. most of these are bidirectional, and the way they solve the crashing issue is by essentially making 2 single direction gateways. For example: if you have a connection between the New York and the Texas system, you have a gate that goes from New York to Texas that stops in open space, and a short distance from where you exit in Texas, there's the gate from Texas to New York that also stops in open space. It's a similar system to how decent restaurants have 2 doors to the kitchen: one for entering the kitchen and one for leaving the kitchen.