# Shortest-Path-Preserving Rounding

**Authors:** Herman Haverkort, David K\"ubel, and Elmar Langetepe

arXiv: 1905.08621 · 2019-05-22

## TL;DR

This paper investigates the complexity of rounding real edge weights in graphs to integers while preserving shortest paths within a specified error, proving NP-hardness in general but providing efficient solutions for trees.

## Contribution

It establishes NP-hardness for the general problem and offers a polynomial-time algorithm for trees, advancing understanding of weight rounding in graph algorithms.

## Key findings

- NP-hardness of the general problem via reduction from 3-SAT
- Polynomial-time algorithm for trees with O(n^2) complexity
- Clarifies the computational limits of shortest-path-preserving rounding

## Abstract

Various applications of graphs, in particular applications related to finding shortest paths, naturally get inputs with real weights on the edges. However, for algorithmic or visualization reasons, inputs with integer weights would often be preferable or even required. This raises the following question: given an undirected graph with non-negative real weights on the edges and an error threshold $\varepsilon$, how efficiently can we decide whether we can round all weights such that shortest paths are maintained, and the change of weight of each shortest path is less than $\varepsilon$? So far, only for path-shaped graphs a polynomial-time algorithm was known. In this paper we prove, by reduction from 3-SAT, that, in general, the problem is NP-hard. However, if the graph is a tree with $n$ vertices, the problem can be solved in $O(n^2)$ time.

## Figures

2 figures with captions in the complete paper: https://tomesphere.com/paper/1905.08621/full.md

---
Source: https://tomesphere.com/paper/1905.08621