Servidor de Rotas Ver histórico

Revisão de 18h35min de 7 de maio de 2017 por Hebermc (discussão | contribs) (Traduzindo....)

Ao utilizar o aplicativo Waze, os servidores do Waze usam algoritmos de roteamento para determinar a melhor rota para um dterminado destino naquele momento. Os detalhes de implementação do algoritmo de roteamento utilizado pelo Waze não são divulgados publicamente e as seguintes informações são baseadas em observações, especulação e alguns detalhes informados pelo staff do Waze. A operação do servidor de roteamento é considerada proprietaria e uma vantagem competitiva do Waze. Também é assumido que pode haver mudanças e que qualquer informação descoberta pode estar incompleta ou desatualizada.

Roteamento no aplicativo do usuário

Calcular a melhor rota é uma tarefa dificil, o aplicativo Waze possui um algoritmo interno de calculo de rota, no entanto este só é utilizado se não houver conexão com o servidor do Waze.

Pedidos de Roteamento

Quando você pede uma rota para o destino o pedido é enviado para o servidor do Waze. A rota calculada pelo servidor é enviada de volta para o dispositivo cliente e exibida.

Os pedidos de roteamento são diferenciados pelas configurações escolhidas no seu dispositivo. No menu de Navegação você pode escolher:

  • Rota mais rapida ou mais curta
  • Permitir ou evitar pedagios
  • Permitir ruas sem calçamento, não permitir ruas sem calçamento ou permitir ruas sem calçamento curtas
  • Evitar rodovias

A rota mais curta se refere a distância fisica. A maior parte das pessoas preferem a rota mais rapida, 100km em rodovias é melhor que 90 km em ruas.

Ruas faltando e Conexões incorretas em junções

Waze tenta encontrar a melhor rota entre você e seu destino baseado nas configurações de navegação, Obviamente só é possivel rotear por ruas que estejam registradas nos servidores do Waze, então pode existir uma rota melhor que não será escolhida por ruas estarem faltando ou junções serem incorretas, para corrigir estas faltas/erros utilize o Waze Map Editor (Editor de Mapas do Waze). Observe também que se [[Segment length|segments segmentos tiverem um comprimento menor que o minimo Segment length/Minimum]], pode haver erros de roteamento.

Velocidade de ruas em tempo real

O servidor de roteamento utiliza velocidades de ruas em tempo real (de usuários recentes do Waze se estiverem disponiveis) e os combina com velocidades historicas de cada segmento em periodos de 10 a 15 minutos. O tempo para percorrer cada segmento é monitorando separadamente para cada destino saindo do segmento. Por exemplo se um segmento tem uma curva a esquerda e uma a direita, então o servidor de roteamento armazena o tempo para percorrer o segmento virando a esquerda no fim e o tempo para percorrer o segmento virando a direita no fim. Estas informações detalhadas são proprietarias e parte dos dados vendidos ou planejados para ser vendidos pelo Waze e não serão vistos no editor de mapas.

Sabemos que o Waze utiliza dados de tempo real da velocidade das ruas em preferência aos dados historicos. Waze também utiliza dados de engarrafamento enviados pelos dispostivo dos usuários para rotear outros usuários desviando de transito lento. É assumido que a velocidade de um Wazer adiante de você será utilizado para calculos de roteamento.

A medida que o número e densidade de Wazers cresce, os dados de tempo real se tornam mais relevantes. A importancia destes dados existe devido ao objetivo inicial do Waze que é criar rotas ótimas. Como o Waze passou a ser utilizado como um GPS generico os dados historicos se tornaram mais importantes em ruas pouco trafegadas.

O algoritmo do Waze utiliza o tempo estimado para percorrer um segmento baseado na velocidade e comprimneto de cada segmento, então ele não pode usar dados de tempo real quando os segmentos estiverem a mais de 15 a 30 minutos da posição inicial. Para estes segmentos o Waze aguarda chegar neles e então faz um novo cálculo de rota exibindo o novo Horário Estimado de Chegada e verifica se existe uma rota melhor segundo as configurações do usuário.

Roteamento mais Rápido

O Waze sabe a velocidade média de cada segmento confirmado entre você e seu destino. O servidor Waze pode calcular qual sequencia de ruas utilizar para minimizar o tempo de percurso

Todos os pedidos de rota são processados em tempo real, no entanto foi observado que Waze memoriza algumas rotas ou rotas entre dois pontos. Isto quer dizer que se o servidor já conhece a melhor rota do ponto B para o ponto C e você pede a rota do ponto A para ponto C passando por B, então o servidor apenas calulca a rota entre A e B, também são calculadas rotas desviando de B para obter a rota mais rápida. No entanto, quando houver uma atualização do mapa algumas rotas podem não ser as mais eficientes enquanto o Waze recalcula e armazena as novas rotas.

A rota mais eficiente tem calculo complexo, a complexidade é relacionada as velocidades médias dos segmentos.

Mudanças na rota devido a mudança na origem

Consider calculating a route from A to Z. The suggested route might be A to B to C to D to Z. Then calculate the route from B to Z. You might get a suggested route of B to C to E to Z. At first glance, this suggests one route is not optimal because the origin changed.

We can guess at what might be happening. There might be a problem associated with the possible caching of routes. Or there might be a "timing window" effect. The different arrival time at C might change the best route to Z. Or there might be a fine tuning effect in the route, perhaps to avoid too many turns. So by dropping the segment A to B, the segments C to E to Z no longer exceed some threshold.

This effect can be observed while driving. If you recalculate a route to a destination while driving along an already calculated route to that same destination, the route can change.

Waze sometimes offers a new route to bypass heavy traffic which raises the question as to when and how Waze considers rerouting.

Changes in routes due to different route lengths

In addition, it is known that the Waze routing engine can't calculate every possible route for long distance routes, so it takes shortcuts for longer routes, potentially resulting in the route changing dramatically when lengthened slightly. According to Waze support (as of July 2011), the section of a route more than 10 km from each endpoint is heavily weighted towards non-streets (i.e. "Primary Streets" or the various Highway types). It is believed that Waze servers simply ignore streets outside of the 10 km radius from the endpoints when doing its calculations to speed up the process.

Problems with average road speeds

If the average road speed is not correct, then the route will not be optimal. However, it is never recommended to delete segments in order to reset the average road speed for that segment. Waze uses the data from Wazers traveling through the segments to update the average speed. If you suspect Waze is not using certain segments along a route, there are a number of other reasons that can cause such a situation. Don't assume deleting the segment is the place to start.

The following are reasons why the routing engine might not use the average road speed.

Time of day variations

Consider a road that most Wazers drive at 5pm when the average speed is 12 mph. You choose your route at 10am when the road is clear and the average speed is 60mph. It is the best road to take, but Waze chooses a different route because it has no information about the speed at 10am and assumes the speeds is 12mph all day.

You can, of course, drive the road yourself, and Waze eventually learns the speed for that time. We do not know how long Waze holds the older data in computing the average speed. However, if Waze does discard old time information, you might not accumulate new time faster than it is discarded. It is also possible that your times are being ignored as being abnormal.

More Waze users would help fix this.

Turn delays

On a segment of a road, your average speed can be very different depending on what you do at the end of the segment. Traffic going straight through a traffic light might go very fast while traffic turning left might wait a very long time. A freeway exit lane might go fast while traffic continuing hits congestion.

Waze has the ability to separately track the average speed of traffic that passes through a segment, but exits to different segments. The routing engine takes this into account. In the diagram, multiple times are tracked for traffic flowing through Seg4 based on the segments to which it exits. There are then two average drive times for:

  • Seg4 to Jnct2 to Seg5
  • Seg4 to Jnct2 to Seg6

Traffic building up on Seg4 that turns right to Seg6 does not affect the route timing for the traffic also using Seg4, but instead turning left to Seg5. For this reason it is important to keep long segment lengths before junctions as traffic congestion at the junction might affect exits differently.

To understand this problem better, consider if we add a short Seg8 between Seg7 and Jnct4. Let's say the traffic exiting Seg10 backs up all the way to Seg7 (easy enough, since Seg8 is short). Because Seg7 only has a single exiting segment (Seg8), the routing server is only able to collect a single average speed — it can no longer distinguish traffic by where it is going after Seg8. Now the through traffic going to Seg9 appears to Waze to slow down through Seg7, even though it doesn't in reality. At a minimum this causes an incorrect ETA for routing, and it might actually cause traffic to be rerouted unnecessarily, and less optimally, through another route. Hence, if there is a chance that traffic can go in different directions at a junction and that junction can experience different amounts of congestion, you should keep the segment before that junction long.

Note this data is not presented to users through the Waze Map Editor, but is only visible to the routing server.

Traffic lights and stop signs

Waze does not record the location of traffic lights. While some GPS navigation offers guidance like "turn right at the next traffic light" the information is frequently incomplete, incorrect or outdated. The consensus view is that Waze should not record the location of traffic lights.

Waze does take traffic lights and stop signs into account by noting the effect they have on traffic speed. Consider a traffic light with long waiting times. The road segment leading to that traffic light will have a low average speed. If the average speed (based on the average waiting time) becomes low enough, a longer route that avoids the light becomes the preferred route. This has been observed in practice and is an example of emergent behaviour. Waze isn't programmed to avoid traffic lights but it does avoid slow roads; if the traffic lights make the road slow then Waze avoids them.

Some drivers regularly take longer routes — even winding through side streets — to avoid any stops or traffic lights. Waze has been known to suggest this, and also known to revert to waiting at lights when better average speed information is collected from the side streets. But note that this can be less than optimal due to the turn delays discussed above.

Outdated and abnormal road speeds

Road conditions change, construction work comes and goes, and average road speeds can change dramatically. One day you might be stuck behind a truck, and another day you might be crawling along the roads at 2 a.m. transporting your pet goldfish. Or your GPS might have a glitch and show you travelling at 1,000 mph.

In short, average speeds can change over time, and recorded times can be abnormal or just plain wrong—and can stay wrong for a very long time.

We can assume Waze is aware of this. There is some evidence that abnormal road speeds and old road speeds are discarded, or at least not used in calculating the average speeds of roads.

Average road speed "shrinking window"

If there are enough recorded speeds on a road, then Waze uses a shrinking window of speeds to better estimate the average speed at the time you are travelling on it. Waze uses the speed of each road segment (in both directions) in intervals as small as 30 minutes. So a two-way road might have up to 96 average road speeds. We can assume that when there are insufficient records for an individual time slot, a wider time range is used (up to a full day). As the road is driven more, the time slot shrinks down to 30 minutes.

We can speculate that there is additional information used that is based upon the day of the week. There is some observational evidence that a road that is busy on weekdays and not used for routing is chosen as the optimal route on weekends.

At some point, Waze also needs to consider the months of the year as seasonal variations can affect the speed of the roads.

Waze uses the average road segment speed for the time slot that applies at the time you are expected to arrive at that road segment.

Because of this "time window", Waze suggests different routes at different times of day. This is dependent on how many times are recorded on the roads along the route. If they're all recorded at about the same time of day, then the time window does not help. If 1,000 times are recorded at about 5 p.m. and 2 times are recorded at 10 a.m., then your 10 a.m. average speed still is based mostly on times from around 5 p.m.

Routing algorithm refinements

Routing options

It's easy to see how routing options can be implemented. For example, to minimize turns we can add a time penalty for fastest routing or a distance penalty for shortest routing, when calculating the fastest or shortest route.

Junction penalties

For newly created roads, currently Waze applies a five-second time penalty for each junction through which a route passes. Once vehicles drive over that road and generate Waze traffic data, the penalty for these junctions is dropped.

What to do if you think the generated route is wrong

Firstly, use the option to generate alternative routes. This might give you some clues as to why Waze is offering that route.

Secondly, if you think there is a better route, check in WME that the roads are all connected along the route.

Thirdly, post a message detailing the problem route - origin, destination and a WME permalink to the Navigation forum. Other eyes will check it, and you might indeed find a flaw in the Waze routing algorithm. Fixing it might make it better for everyone.

Change of routing

When Waze receives notification of traffic conditions it uses the actual speed of roads on your route, rather than the average speed. This is based only on the automatic traffic condition reports - light, moderate, heavy traffic or complete standstill. Manual reports of traffic jams and accidents are for your information only and do not change routing.

It might be that even with the traffic reports, there is no better route and Waze cannot offer you one.

You are the driver

Waze can never see that the traffic light is green going straight, or know that today is a public holiday. It can offer you guidance as to what is the best route under average conditions. But you are the driver and you are in the best position to make the decision for today under today's conditions.

If everyone followed Waze directions and never drove on a new route, Waze might never learn that route is better. When Waze is recording your travels, every trip helps make Waze better for everyone. That includes when you think you know better. Sometimes you will be right. And sometimes you will be wrong. But it is better to find out you are wrong so you can choose the better route. And when you are right, all Waze users benefit by the sharing of your knowledge.