You are on page 1of 54

Algorithms and Computation 25th

International Symposium ISAAC 2014


Jeonju Korea December 15 17 2014
Proceedings 1st Edition Hee-Kap Ahn
Visit to download the full and correct content document:
https://textbookfull.com/product/algorithms-and-computation-25th-international-sympo
sium-isaac-2014-jeonju-korea-december-15-17-2014-proceedings-1st-edition-hee-ka
p-ahn/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Combinatorial Algorithms 25th International Workshop


IWOCA 2014 Duluth MN USA October 15 17 2014 Revised
Selected Papers 1st Edition Kratochvíl Jan

https://textbookfull.com/product/combinatorial-algorithms-25th-
international-workshop-iwoca-2014-duluth-mn-usa-
october-15-17-2014-revised-selected-papers-1st-edition-
kratochvil-jan/

Algorithms and Computation 8th International Workshop


WALCOM 2014 Chennai India February 13 15 2014
Proceedings 1st Edition Kurt Mehlhorn (Auth.)

https://textbookfull.com/product/algorithms-and-computation-8th-
international-workshop-walcom-2014-chennai-india-
february-13-15-2014-proceedings-1st-edition-kurt-mehlhorn-auth/

Security Standardisation Research First International


Conference SSR 2014 London UK December 16 17 2014
Proceedings 1st Edition Liqun Chen

https://textbookfull.com/product/security-standardisation-
research-first-international-conference-ssr-2014-london-uk-
december-16-17-2014-proceedings-1st-edition-liqun-chen/

Applied Algorithms First International Conference ICAA


2014 Kolkata India January 13 15 2014 Proceedings 1st
Edition Bhargab B. Bhattacharya

https://textbookfull.com/product/applied-algorithms-first-
international-conference-icaa-2014-kolkata-india-
january-13-15-2014-proceedings-1st-edition-bhargab-b-
Experimental Algorithms 13th International Symposium
SEA 2014 Copenhagen Denmark June 29 July 1 2014
Proceedings 1st Edition Joachim Gudmundsson

https://textbookfull.com/product/experimental-algorithms-13th-
international-symposium-sea-2014-copenhagen-denmark-
june-29-july-1-2014-proceedings-1st-edition-joachim-gudmundsson/

Simulated Evolution and Learning 10th International


Conference SEAL 2014 Dunedin New Zealand December 15 18
2014 Proceedings 1st Edition Grant Dick

https://textbookfull.com/product/simulated-evolution-and-
learning-10th-international-conference-seal-2014-dunedin-new-
zealand-december-15-18-2014-proceedings-1st-edition-grant-dick/

Web and Internet Economics 10th International


Conference WINE 2014 Beijing China December 14 17 2014
Proceedings 1st Edition Tie-Yan Liu

https://textbookfull.com/product/web-and-internet-economics-10th-
international-conference-wine-2014-beijing-china-
december-14-17-2014-proceedings-1st-edition-tie-yan-liu/

Network and System Security 8th International


Conference NSS 2014 Xi an China October 15 17 2014
Proceedings 1st Edition Man Ho Au

https://textbookfull.com/product/network-and-system-security-8th-
international-conference-nss-2014-xi-an-china-
october-15-17-2014-proceedings-1st-edition-man-ho-au/

Intelligent Robotics and Applications 7th International


Conference ICIRA 2014 Guangzhou China December 17 20
2014 Proceedings Part II 1st Edition Xianmin Zhang

https://textbookfull.com/product/intelligent-robotics-and-
applications-7th-international-conference-icira-2014-guangzhou-
china-december-17-20-2014-proceedings-part-ii-1st-edition-
Hee-Kap Ahn
Chan-Su Shin (Eds.)
ARCoSS
LNCS 8889

Algorithms
and Computation
25th International Symposium, ISAAC 2014
Jeonju, Korea, December 15–17, 2014
Proceedings

123
Lecture Notes in Computer Science 8889
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen

Editorial Board

David Hutchison, UK Takeo Kanade, USA


Josef Kittler, UK Jon M. Kleinberg, USA
John C. Mitchell, USA Friedemann Mattern, Switzerland
Bernhard Steffen, Germany Moni Naor, Israel
Demetri Terzopoulos, USA C. Pandu Rangan, India
Gerhard Weikum, Germany Doug Tygar, USA

Advanced Research in Computing and Software Science


Subline of Lecture Notes in Computer Science

Subline Series Editors


Giorgio Ausiello, University of Rome ‘La Sapienza’, Italy
Vladimiro Sassone, University of Southampton, UK

Subline Advisory Board


Susanne Albers, TU Munich, Germany
Benjamin C. Pierce, University of Pennsylvania, USA
Bernhard Steffen, University of Dortmund, Germany
Deng Xiaotie, City University of Hong Kong
Jeannette M.Wing, Microsoft Research, Redmond, WA, USA
More information about this series at http://www.springer.com/series/7407
Hee-Kap Ahn · Chan-Su Shin (Eds.)

Algorithms
and Computation
25th International Symposium, ISAAC 2014
Jeonju, Korea, December 15–17, 2014
Proceedings

ABC
Editors
Hee-Kap Ahn Chan-Su Shin
Pohang University of Science and Technology Hankuk University of Foreign Studies
Pohang Yongin-si
Korea, Republic of (South Korea) Korea, Republic of (South Korea)

ISSN 0302-9743 ISSN 1611-3349 (electronic)


ISBN 978-3-319-13074-3 ISBN 978-3-319-13075-0 (eBook)
DOI 10.1007/978-3-319-13075-0

Library of Congress Control Number: 2014955201

LNCS Sublibrary: SL1 – Theoretical Computer Science and General Issues

Springer Cham Heidelberg New York Dordrecht London

c Springer International Publishing Switzerland 2014


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broad-
casting, reproduction on microfilms or in any other physical way, and transmission or information storage
and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known
or hereafter developed. Exempted from this legal reservation are brief excerpts in connection with reviews
or scholarly analysis or material supplied specifically for the purpose of being entered and executed on a
computer system, for exclusive use by the purchaser of the work. Duplication of this publication or parts
thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its cur-
rent version, and permission for use must always be obtained from Springer. Permissions for use may be
obtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution under
the respective Copyright Law.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material
contained herein.

Printed on acid-free paper


Springer is part of Springer Science+Business Media (www.springer.com)
Preface

The papers in this volume were presented at the 25th International Symposium on Al-
gorithms and Computation (ISAAC 2014), held in Jeonju, South Korea, during De-
cember 15–17, 2014. In the past, ISAAC was held in Tokyo (1990), Taipei (1991),
Nagoya (1992), Hong Kong (1993), Beijing (1994), Cairns (1995), Osaka (1996), Sin-
gapore (1997), Taejon (1998), Chennai (1999), Taipei (2000), Christchurch (2001),
Vancouver (2002), Kyoto (2003), Hong Kong (2004), Hainan (2005), Kolkata (2006),
Sendai (2007), Gold Coast (2008), Hawaii (2009), Jeju (2010), Yokohama (2011),
Taipei (2012), and Hong Kong (2013) over 25 years from 1990 to 2014.
ISAAC is an acclaimed annual international symposium that covers a wide range
of topics in algorithms and theory of computation, and that provides a forum for re-
searchers where they can exchange ideas in this active research community. In response
to the call for papers, ISAAC 2014 received 171 submissions from 38 countries. Each
submission was reviewed by at least three Program Committee members with the assis-
tance of 189 external reviewers. Through extensive discussion, the Program Committee
selected 60 papers for presentation in ISAAC 2014. Two special issues, one of Algo-
rithmica and one of International Journal of Computational Geometry and Applications,
are prepared for some selected papers among the presented ones in ISAAC 2014.
The best paper award was given to “Concentrated Hitting Times of Randomized
Search Heuristics with Variable Drift” by Per Kristian Lehre and Carsten Witt. Two
eminent invited speakers, Ulrik Brandes from University of Konstanz, Germany and
Giuseppe F. Italiano from Università di Roma “Tor Vergata”, Italy, gave interesting
invited talks at the conference.
We would like to thank all Program Committee members and external reviewers
for their excellent work in the difficult review and selection process. We would like to
thank all authors who submitted papers for our consideration; they all contributed to the
high quality of the conference. We would like to thank Conference Chair Kunsoo Park
and Organizing Committee members for their dedicated contribution. Finally, we would
like to thank our conference volunteers, sponsor SRC-GAIA (Center for Geometry and
Its Applications), and supporting organizations KIISE (The Korean Institute of Infor-
mation Scientists and Engineers) and SIGTCS (Special Interest Group on Theoretical
Computer Science) of KIISE for their assistance and support.

December 2014 Hee-Kap Ahn


Chan-Su Shin
Organization

Program Committee
Hee-Kap Ahn Pohang University of Science and Technology,
South Korea
Peter Brass City College of New York, USA
Gerth Stølting Brodal Aarhus University, Denmark
Xavier Goaoc University Paris-Est Marne-la-Vallé, France
Simon Gog University of Melbourne, Australia
Mordecai Golin Hong Kong University of Science and Technology,
Hong Kong
Roberto Grossi University of Pisa, Italy
Sungjin Im University of California, Merced, USA
Rahul Jain National University of Singapore, Singapore
Akinori Kawachi Tokyo Institute of Technology, Japan
Christian Knauer Universität Bayreuth, Germany
Pinyan Lu Microsoft Research Asia, China
Kazuhisa Makino RIMS, Kyoto University, Japan
Peter Bro Miltersen Aarhus University, Denmark
Wolfgang Mulzer Freie Universität Berlin, Germany
Joong Chae Na Sejong University, South Korea
Srinivasa Rao Satti Seoul National University, South Korea
Saket Saurabh Institute of Mathematical Sciences, India
Tetsuo Shibuya University of Tokyo, Japan
Chan-Su Shin Hankuk University of Foreign Studies, South Korea
Michiel Smid Carleton University, Canada
Hisao Tamaki Meiji University, Japan
Gerhard Woeginger Eindhoven University of Technology,
The Netherlands
Alexander Wolff Universität Würzburg, Germany
Bang Ye Wu National Chung Cheng University, Taiwan
Chee Yap New York University, USA
Hsu-Chun Yen National Taiwan University, Taiwan
Louxin Zhang National University of Singapore, Singapore
Peng Zhang Shandong University, China
Xiao Zhou Tohoku University, Japan
Binhai Zhu Montana State University, USA
VIII Organization

Additional Reviewers
Alt, Helmut He, Meng
Anagnostopoulos, Aris Henze, Matthias
Anshu, Anurag Higashikawa, Yuya
Antoniadis, Antonios Hsieh, Sun-Yuan
Asinowski, Andrei Huang, Guan-Shieng
Bae, Sang Won Hubard, Alfredo
Barba, Luis Imai, Tatsuya
Barbay, Jérémy Ishii, Toshimasa
Bille, Philip Ito, Takehiro
Bonichon, Nicolas Ivanyos, Gabor
Bonsma, Paul Jaume, Rafel
Brandstadt, Andreas Jiang, Minghui
Braverman, Vladimir Jo, Seungbum
Cabello, Sergio Johnson, Matthew
Cela, Eranda Kakoulis, Konstantinos
Chang, Ching-Lueh Kamiyama, Naoyuki
Chang, Jou-Ming Kavitha, Telikepalli
Chen, Ho-Lin Kim, Heuna
Chen, Jiecao Kim, Jin Wook
Chen, Xin Kim, Sung-Ryul
Chlamtac, Eden Kindermann, Philipp
Colin de Verdière, Éric Kiraly, Tamas
Da Lozzo, Giordano Klauck, Hartmut
Devillers, Olivier Kobayashi, Yusuke
Dobbins, Michael Gene Kolay, Sudeshna
Dürr, Christoph Kortsarz, Guy
Elbassioni, Khaled Kratsch, Dieter
Elmasry, Amr Kriegel, Klaus
Epstein, Leah Kuang, Jian
Fernau, Henning Kulkarni, Raghav
Fiorini, Samuel Laekhanukit, Bundit
Fleszar, Krzysztof Lampis, Michael
Fuchs, Fabian Langetepe, Elmar
Fukunaga, Takuro Le Gall, Francois
Giannopoulos, Panos Lee, Inbok
Giaquinta, Emanuele Lee, Mun-Kyu
Golovach, Petr Lee, Troy
Grunert, Romain Leike, Jan
Gunawan, Andreas D.M. Levin, Asaf
Gupta, Ankur Li, Liang
Gupta, Sushmita Liao, Chung-Shou
Gurski, Frank Lin, Chengyu
Hajiaghayi, Mohammadtaghi Lin, Chun-Cheng
Hatano, Kohei Liotta, Giuseppe
Organization IX

Liu, Jingcheng Sadakane, Kunihiko


Liu, Zhengyang Sarrabezolles, Pauline
M.S., Ramanujan Schneider, Stefan
Mcauley, Julian Schulz, André
Megow, Nicole Seiferth, Paul
Mestre, Julian Seto, Kazuhisa
Misra, Neeldhara Shah, Rahul
Miura, Kazuyuki Shao, Mingfu
Mizuki, Takaaki Shioura, Akiyoshi
Mondal, Debajyoti Sim, Jeong Seop
Montanaro, Ashley Sitters, Rene
Montenegro, Ravi Spoerhase, Joachim
Mori, Ryuhei Stehn, Fabian
Mukherjee, Joydeep Stein, Yannik
Mustafa, Nabil Suzuki, Akira
Navarro, Gonzalo Sæther, Sigve Hortemo
Nies, Andre Takazawa, Kenjiro
Nishimura, Harumichi Tamaki, Suguru
O Dunlaing, Colm Tani, Seiichiro
Ochem, Pascal Tanigawa, Shin-Ichi
Ohlebusch, Enno Ting, Chuan-Kang
Okamoto, Yoshio Tong, Weitian
Onodera, Taku Tsur, Dekel
Osipov, Vitaly Uchizawa, Kei
Otachi, Yota Uno, Takeaki
Oudot, Steve Upadhyay, Sarvagya
Panolan, Fahad van Iersel, Leo
Park, Heejin van Stee, Rob
Paulusma, Daniel Vialette, Stephane
Peleg, David Vind, Søren
Peng, Dongliang Wahlström, Magnus
Peng, Pan Wakabayashi, Yoshiko
Petri, Matthias Wang, Bow-Yaw
Pilaud, Vincent Wang, Hung-Lung
Pilipczuk, Michal Wang, Menghui
Poon, Sheung-Hung Wang, Yue-Li
Praveen, M. Wu, Chenchen
Pruhs, Kirk Wu, Zhilin
Pérez-Lantero, Pablo Wulff-Nilsen, Christian
Rahman, Md. Saidur Xia, Mingji
Rai, Ashutosh Xiao, Mingyu
Rautenbach, Dieter Xiao, Tao
Rotbart, Noy Xu, Ning
Rote, Günter Yamamoto, Masaki
Rutter, Ignaz Yang, Chang-Biau
Sabharwal, Yogish Yang, De-Nian
X Organization

Yang, Kuan Zhang, Jialin


Yasunaga, Kenji Zhang, Shengyu
Ye, Deshi Zhang, Yong
Zaffanella, Enea Zielinski, Pawel
Zhang, Chihao
Invited Talks
Biconnectivity in Directed Graphs

Giuseppe F. Italiano
Univ. of Rome “Tor Vergata”, Via del Politecnico 1, 00133 Roma, Italy
giuseppe.italiano@uniroma2.it

Edge and vertex connectivity are fundamental concepts in graph theory with nu-
merous practical applications. Given an undirected graph G = (V, E), an edge
is a bridge if its removal increases the number of connected components of G.
Graph G is 2-edge-connected if it has no bridges. The 2-edge-connected compo-
nents of G are its maximal 2-edge-connected subgraphs. Two vertices v and w
are 2-edge-connected if there are two edge-disjoint paths between v and w: we
denote this relation by v ↔2e w. Equivalently, by Menger’s Theorem, v and w
are 2-edge-connected if the removal of any edge leaves them in the same con-
nected component. Analogous definitions can be given for 2-vertex connectivity.
In particular, a vertex is an articulation point if its removal increases the number
of connected components of G. A graph G is 2-vertex-connected if it has at least
three vertices and no articulation points. The 2-vertex-connected components
of G are its maximal 2-vertex-connected subgraphs. Two vertices v and w are
2-vertex-connected if there are two internally vertex-disjoint paths between v
and w: we denote this relation by v ↔2v w. If v and w are 2-vertex-connected
then Menger’s Theorem implies that the removal of any vertex different from
v and w leaves them in the same connected component. The converse does not
necessarily hold, since v and w may be adjacent but not 2-vertex-connected.
It is easy to show that v ↔2e w (resp., v ↔2v w) if and only if v and w are
in a same 2-edge-connected (resp., 2-vertex-connected) component. All bridges,
articulation points, 2-edge- and 2-vertex-connected components of undirected
graphs can be computed in linear time essentially by the same algorithm based
on depth-first search.
While edge and vertex connectivity have been thoroughly studied in the case
of undirected graphs, surprisingly not much has been investigated for directed
graphs. Given a directed graph G, an edge (resp., a vertex) is a strong bridge
(resp., a strong articulation point ) if its removal increases the number of strongly
connected components of G. A directed graph G is 2-edge-connected (resp., 2-
vertex-connected) if it has no strong bridges (resp., strong articulation points
and has at least three vertices). The 2-edge-connected (resp., 2-vertex-connected)
components of G are its maximal 2-edge-connected (resp., 2-vertex-connected)
subgraphs. Similarly to the undirected case, we say that two vertices v and w
are 2-edge-connected (resp., 2-vertex-connected), and we denote this relation by

*
Work partially supported by the Italian Ministry of Education, University and Re-
search, under Project AMANDA (Algorithmics for MAssive and Networked DAta).
XIV G.F. Italiano

v ↔2e w (resp., v ↔2v w), if there are two edge-disjoint (resp., internally vertex-
disjoint) directed paths from v to w and two edge-disjoint (resp., internally
vertex-disjoint) directed paths from w to v. (Note that a path from v to w
and a path from w to v need not be edge-disjoint or vertex-disjoint). It is easy
to see that v ↔2e w if and only if the removal of any edge leaves v and w
in the same strongly connected component. Similarly, v ↔2v w implies that
the removal of any vertex different from v and w leaves v and w in the same
strongly connected component. We define a 2-edge-connected block (resp., 2-
vertex-connected block ) of a directed graph G = (V, E) as a maximal subset
B ⊆ V such that u ↔2e v (resp., u ↔2v v) for all u, v ∈ B. It can be seen
that, differently from undirected graphs, in directed graphs 2-edge- and 2-vertex-
connected blocks do not correspond to 2-edge-connected and 2-vertex-connected
components.
Furthermore, these notions seem to have a much richer (and more com-
plicated) structure in directed graphs. Just to give an example, we observe
that while in the case of undirected connected graphs the 2-edge-connected
components (which correspond to the 2-edge-connected blocks) are exactly the
connected components left after the removal of all bridges, for directed strongly
connected graphs the 2-edge-connected components, the 2-edge-connected blocks,
and the strongly connected components left after the removal of all strong bridges
are not necessarily the same.
In this talk, we survey some very recent work on 2-edge and 2-vertex connec-
tivity in directed graphs, both from the theoretical and the practical viewpoint.
Social Network Algorithmics

Ulrik Brandes

Computer & Information Science, University of Konstanz

Network science is a burgeoning domain of data analysis in which the focus is


on structures and dependencies rather than populations and independence [1].
Social network analysis is network science applied to the empirical study of social
structures, typically utilizing observations on social relationships to analyze the
actors involved in them [2].
Methods for the analysis of social networks abound. They include, for in-
stance, numerous centrality indices, vertex equivalences, and clustering tech-
niques, many of which are applied on networks in other disciplines as well. For
substantively oriented analysts, however, it is often difficult to choose, let alone
justify, a particular variant method. Similarly, it is difficult for researchers inter-
ested in computational aspects to understand which methods are worthwhile to
consider and whether variants and restrictions are meaningful and relevant.
In an attempt to bridge the gap between theory and methods, and drawing
on a substantial record of interdisciplinary cooperation, we have developed a
comprehensive research program, the positional approach to network analysis. It
provides a unifying framework for network analysis in the pursuit of two closely
related goals:

1. to establish a science of networks, and


2. to facilitate mathematical and algorithmic research.

The first caters to methodologists and social scientists: by embracing mea-


surement theory, network-analytic methods are opened up for theoretical justifi-
cation and detailed empirical testing. The second caters to mathematicians and
computer scientists: by structuring the space of methods, gaps and opportunities
are exposed.
After a brief introduction and delineation of network science and social net-
work analysis, the main elements of the positional approach are introduced in
this talk. I will then concentrate on exemplary instantiations for analytic con-
cepts such as centrality, roles, and cohesion. Particular emphasis is placed on
resulting combinatorial and algorithmic challenges involving, for instance, par-
tial orders, graphs, and path algebras.

*
I gratefully acknowledge financial support from DFG under grant Br 2158/6-1.
XVI U. Brandes

References
1. Brandes, U., Robins, G., McCranie, A., Wasserman, S.: What is network science?
Network Science 1(1), 1–15 (2013)
2. Hennig, M., Brandes, U., Pfeffer, J., Mergel, I.: Studying Social Networks – A Guide
to Empirical Research. Campus, Frankfurt/New York (2012)
Contents

Computational Geometry I

Line-Constrained k-Median, k-Means, and k-Center Problems in the Plane . . 3


Haitao Wang and Jingru Zhang

Reconstructing Point Set Order Types from Radial Orderings . . . . . . . . . . . 15


Oswin Aichholzer, Jean Cardinal, Vincent Kusters, Stefan Langerman,
and Pavel Valtr

A Randomized Divide and Conquer Algorithm for Higher-Order Abstract


Voronoi Diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Cecilia Bohler, Chih-Hung Liu, Evanthia Papadopoulou,
and Maksym Zavershynskyi

Combinatorial Optimization I

Average-Case Complexity of the Min-Sum Matrix Product Problem. . . . . . . 41


Ken Fong, Minming Li, Hongyu Liang, Linji Yang, and Hao Yuan

Efficiently Correcting Matrix Products . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


Leszek Ga˛sieniec, Christos Levcopoulos, and Andrzej Lingas

3D Rectangulations and Geometric Matrix Multiplication . . . . . . . . . . . . . . 65


Peter Floderus, Jesper Jansson, Christos Levcopoulos,
Andrzej Lingas, and Dzmitry Sledneu

Graph Algorithms: Enumeration

Enumeration of Maximum Common Subtree Isomorphisms


with Polynomial-Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Andre Droschinsky, Bernhard Heinemann, Nils Kriege, and Petra Mutzel

Efficient Enumeration of Induced Subtrees in a K-Degenerate Graph . . . . . . 94


Kunihiro Wasa, Hiroki Arimura, and Takeaki Uno

An Efficient Method for Indexing All Topological Orders


of a Directed Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Yuma Inoue and Shin-ichi Minato
XVIII Contents

Matching and Assignment I

Planar Matchings for Weighted Straight Skeletons . . . . . . . . . . . . . . . . . . . 117


Therese Biedl, Stefan Huber, and Peter Palfrader

Orienting Dynamic Graphs, with Applications to Maximal Matchings


and Adjacency Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Meng He, Ganggui Tang, and Norbert Zeh

Dynamic and Multi-Functional Labeling Schemes . . . . . . . . . . . . . . . . . . . 141


Søren Dahlgaard, Mathias Bæk Tejs Knudsen, and Noy Rotbart

Data Structures and Algorithms I

Hashing and Indexing: Succinct Data Structures and Smoothed Analysis. . . . 157
Alberto Policriti and Nicola Prezza

Top-k Term-Proximity in Succinct Space. . . . . . . . . . . . . . . . . . . . . . . . . . 169


J. Ian Munro, Gonzalo Navarro, Jesper Sindahl Nielsen, Rahul Shah,
and Sharma V. Thankachan

The Power and Limitations of Static Binary Search Trees with Lazy Finger. . . 181
Presenjit Bose, Karim Douïeb, John Iacono, and Stefan Langerman

Fixed-Parameter Tractable Algorithms

Minimum-Cost b-Edge Dominating Sets on Trees . . . . . . . . . . . . . . . . . . . 195


Takehiro Ito, Naonori Kakimura, Naoyuki Kamiyama,
Yusuke Kobayashi, and Yoshio Okamoto

Fixed-Parameter Tractability of Token Jumping on Planar Graphs . . . . . . . . 208


Takehiro Ito, Marcin Kamiński, and Hirotaka Ono

Covering Problems for Partial Words and for Indeterminate Strings . . . . . . . 220
Maxime Crochemore, Costas S. Iliopoulos, Tomasz Kociumaka,
Jakub Radoszewski, Wojciech Rytter, and Tomasz Waleń

Scheduling Algorithms

Dynamic Interval Scheduling for Multiple Machines. . . . . . . . . . . . . . . . . . 235


Alexander Gavruskin, Bakhadyr Khoussainov, Mikhail Kokho, and Jiamou Liu

Throughput Maximization in Multiprocessor Speed-Scaling . . . . . . . . . . . . . 247


Eric Angel, Evripidis Bampis, Vincent Chau, and Nguyen Kim Thang

Speed-Scaling with No Preemptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259


Evripidis Bampis, Dimitrios Letsios, and Giorgio Lucarelli
Contents XIX

Computational Complexity

A Short Implicant of a CNF Formula with Many Satisfying Assignments . . . 273


Daniel M. Kane and Osamu Watanabe

On the Computational Complexity of Vertex Integrity and Component


Order Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Pål Grønås Drange, Markus Sortland Dregi, and Pim van’t Hof

Co-Clustering Under the Maximum Norm . . . . . . . . . . . . . . . . . . . . . . . . . 298


Laurent Bulteau, Vincent Froese, Sepp Hartung, and Rolf Niedermeier

Computational Geometry II

The Price of Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313


Prosenjit Bose, Pat Morin, and André van Renssen

Range Queries on Uncertain Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326


Jian Li and Haitao Wang

On the Most Likely Voronoi Diagram and Nearest Neighbor Searching . . . . 338
Subhash Suri and Kevin Verbeek

Approximation Algorithms

An Improved Approximation Algorithm for the Minimum Common


Integer Partition Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Weitian Tong and Guohui Lin

Positive Semidefinite Relaxation and Approximation Algorithm for Triple


Patterning Lithography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Tomomi Matsui, Yukihide Kohira, Chikaaki Kodama, and Atsushi Takahashi

An FPTAS for the Volume Computation of 0-1 Knapsack Polytopes Based


on Approximate Convolution Integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Ei Ando and Shuji Kijima

Graph Theory and Algorithms

Polynomial-Time Algorithm for Sliding Tokens on Trees . . . . . . . . . . . . . . 389


Erik D. Demaine, Martin L. Demaine, Eli Fox-Epstein, Duc A. Hoang,
Takehiro Ito, Hirotaka Ono, Yota Otachi, Ryuhei Uehara, and Takeshi Yamada

Minimal Obstructions for Partial Representations of Interval Graphs. . . . . . . 401


Pavel Klavík and Maria Saumell

Faster Algorithms for Computing the R* Consensus Tree . . . . . . . . . . . . . . 414


Jesper Jansson, Wing-Kin Sung, Hoa Vu, and Siu-Ming Yiu
XX Contents

Fixed-Parameter Tractable Algorithms II

Complexity and Kernels for Bipartition into Degree-Bounded Induced


Graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Mingyu Xiao and Hiroshi Nagamochi

Faster Existential FO Model Checking on Posets . . . . . . . . . . . . . . . . . . . . 441


Jakub Gajarský, Petr Hliněný, Jan Obdržálek, and Sebastian Ordyniak

Vertex Cover Reconfiguration and Beyond . . . . . . . . . . . . . . . . . . . . . . . . 452


Amer E. Mouawad, Naomi Nishimura, and Venkatesh Raman

Graph Algorithms: Approximation I

Approximating the Maximum Internal Spanning Tree Problem via


a Maximum Path-Cycle Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Xingfu Li and Daming Zhu

Approximation Algorithms Inspired by Kernelization Methods. . . . . . . . . . . 479


Faisal N. Abu-Khzam, Cristina Bazgan, Morgan Chopin, and Henning Fernau

An 5/4-Approximation Algorithm for Sorting Permutations by Short


Block Moves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Haitao Jiang, Haodi Feng, and Daming Zhu

Online and Approximation Algorithms

Lower Bounds for On-line Graph Colorings. . . . . . . . . . . . . . . . . . . . . . . . 507


Grzegorz Gutowski, Jakub Kozik, Piotr Micek, and Xuding Zhu

An On-line Competitive Algorithm for Coloring P8-free Bipartite Graphs . . . 516


Piotr Micek and Veit Wiechert

Bounds on Double-Sided Myopic Algorithms for Unconstrained


Non-monotone Submodular Maximization . . . . . . . . . . . . . . . . . . . . . . . . . 528
Norman Huang and Allan Borodin

Data Structures and Algorithms II

Tradeoff Between Label Space and Auxiliary Space for Representation


of Equivalence Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Hicham El-Zein, J. Ian Munro, and Venkatesh Raman

Depth-First Search Using O(n) Bits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553


Tetsuo Asano, Taisuke Izumi, Masashi Kiyomi, Matsuo Konagaya,
Hirotaka Ono, Yota Otachi, Pascal Schweitzer, Jun Tarui, and Ryuhei Uehara

Dynamic Path Counting and Reporting in Linear Space . . . . . . . . . . . . . . . 565


Meng He, J. Ian Munro, and Gelin Zhou
Contents XXI

Matching and Assignment II

Linear-Time Algorithms for Proportional Apportionment. . . . . . . . . . . . . . . 581


Zhanpeng Cheng and David Eppstein

Rank-Maximal Matchings – Structureand Algorithms . . . . . . . . . . . . . . . . . 593


Pratik Ghosal, Meghana Nasre, and Prajakta Nimbhorkar

The Generalized Popular Condensation Problem. . . . . . . . . . . . . . . . . . . . . 606


Yen-Wei Wu, Wei-Yin Lin, Hung-Lung Wang, and Kun-Mao Chao

Graph Algorithms: Approximation II

Dirichlet Eigenvalues, Local Random Walks, and Analyzing Clusters


in Graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
Pavel Kolev and He Sun

Planar Embeddings with Small and Uniform Faces . . . . . . . . . . . . . . . . . . . 633


Giordano Da Lozzo, Vít Jelínek, Jan Kratochvíl, and Ignaz Rutter

Scheduling Unit Jobs with a Common Deadline to Minimize the Sum


of Weighted Completion Times and Rejection Penalties . . . . . . . . . . . . . . . 646
Nevzat Onur Domaniç and C. Gregory Plaxton

Combinatorial Optimization II

Solving Multi-choice Secretary Problem in Parallel: An Optimal


Observation-Selection Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
Xiaoming Sun, Jia Zhang, and Jialin Zhang

A Geometric Approach to Graph Isomorphism. . . . . . . . . . . . . . . . . . . . . . 674


Pawan Aurora and Shashank K. Mehta

Concentrated Hitting Times of Randomized Search Heuristics with


Variable Drift. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
Per Kristian Lehre and Carsten Witt

Computational Geometry III

Euclidean TSP with Few Inner Points in Linear Space . . . . . . . . . . . . . . . . 701


Paweł Gawrychowski and Damian Rusak

Bottleneck Partial-Matching Voronoi Diagrams and Applications . . . . . . . . . 714


Matthias Henze and Rafel Jaume

Ham-Sandwich Cuts for Abstract Order Types . . . . . . . . . . . . . . . . . . . . . . 726


Stefan Felsner and Alexander Pilz
XXII Contents

Network and Scheduling Algorithms

Graph Orientation and Flows over Time . . . . . . . . . . . . . . . . . . . . . . . . . . 741


Ashwin Arulselvan, Martin Groß, and Martin Skutella

A Simple Efficient Interior Point Method for Min-Cost Flow. . . . . . . . . . . . 753


Ruben Becker and Andreas Karrenbauer

Decremental All-Pairs ALL Shortest Paths and Betweenness Centrality . . . . 766


Meghana Nasre, Matteo Pontecorvi, and Vijaya Ramachandran

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779


Computational Geometry I
Line-Constrained k-Median, k-Means,
and k-Center Problems in the Plane

Haitao Wang and Jingru Zhang(B)

Department of Computer Science, Utah State University, Logan, UT 84322, USA


haitao.wang@usu.edu, jingruzhang@aggiemail.usu.edu

Abstract. The (weighted) k-median, k-means, and k-center problems in


the plane are known to be NP-hard. In this paper, we study these prob-
lems with an additional constraint that requires the sought k facilities to
be on a given line. We present efficient algorithms for various distance
metrics such as L1 , L2 , L∞ . Assume all n weighted points are given sorted
by their projections on the given line. For k-median, our algorithms for L1
√ √
and L∞ metrics run in O(min{nk, n k log n log√n, n2O( log k log log n) log n})

time and O(min{nk log n, n k log n log2 n, n2O( log k log log n) log2 n}) time,
respectively. For k-means,
√ √ defined only on the L2 metric, we
which is
give an O(min{nk, n k log n, n2O( log k log log n) }) time algorithm. For k-
center, our algorithms run in O(n log n) time for all three metrics, and
in O(n) time for the unweighted version under L1 and L∞ metrics.

1 Introduction

It has been known that the (weighted) k-median, k-means, and k-center in the
plane are NP-hard [15,24,27]. In this paper, we study these problems with an
additional constraint that the sought k facilities must be on a given line.
For any point p, denote by x(p) and y(p) its x- and y-coordinates, respec-
tively. For any two points p and q, denote by d(p, q) the distance between p and
q. Depending on the distance metrics, d(p, q) may refer to the L1 distance, i.e.,

|x(p) − x(q)| + |y(p) − y(q)|, or the L2 distance, i.e., (x(p) − x(q))2 + (y(p) − y(q))2 ,
or the L∞ distance, i.e., max{|x(p) − x(q)|, |y(p) − y(q)|}. For convenience, we
define the L22 distance metric as (x(p) − x(q))2 + (y(p) − y(q))2 .
Let P be a set of n points in the plane, and each point p ∈ P has a weight
w(p) > 0. The goal of the k-median (resp., k-center)problem is to find a set Q
of k points (called facilities) in the plane such that p∈P [w(p) · minq∈Q d(p, q)]
(resp., maxp∈P [w(p) · minq∈Q d(p, q)]) is minimized. The k-means problem is
actually the k-median problem under the L22 metric.
If all points of Q are required to be on a given line, denoted by χ, then we
refer to the corresponding problems as line-constrained or simply constrained
k-median, k-means, and k-center problems. In the following paper, we assume χ
is the x-axis and the points of P have been sorted by their x-coordinates.
This research was supported in part by NSF under Grant CCF-1317143.


c Springer International Publishing Switzerland 2014
H.-K. Ahn and C.-S. Shin (Eds.): ISAAC 2014, LNCS 8889, pp. 3–14, 2014.
DOI: 10.1007/978-3-319-13075-0 1
4 H. Wang and J. Zhang

√ √
Table 1. Summary of our results, where τ = min{n k log n, n2O( log k log log n) }.
Furthermore, the unweighted L1 constrained k-median is solved in O(τ ) time. The
unweighted L1 and L∞ constrained k-center are solved in O(n) time.

constrained k-median constrained k-center


L1 O(min{nk, τ log n}) O(n log n)
L∞ O(min{nk log n, τ log2 n}) O(n log n)
L22 O(min{nk, τ }) (i.e., the constrained k-means) not applicable
√ √
Throughout the paper, let τ = min{n k log n, n2O( log k log log n) }. See Table 1
for our results. For the constrained k-median, our algorithms for the L1 and L∞
metrics run in O(min{nk, τ log n}) and O(min{nk log n, τ log2 n}) time, respec-
tively. The L1 unweighted version where all points of P have the same weight can
be solved in O(τ ) time. These time bounds almost match those of the best algo-
rithms for the one-dimensional k-median problems. Note that the L2 version of
the constrained k-median has been shown unsolvable due to the computation chal-
lenge even for k = 1 [5]. For the constrained k-means, we give an O(min{nk, τ })
time algorithm. For the constrained k-center, our algorithms run in O(n log n)
time for all three metrics, and in O(n) time for the unweighted version under L1
and L∞ metrics. These k-center results are optimal.
Our results show that although these problems in 2D are hard, their “1.5D”
versions are “easy”. A practical example in which the facilities are restricted to
lie along a line is that we want to build some supply centers along a railway
or highway (although a railway or highway may not be a straight line, it may
be considered straight in each local area). Other relevant examples may include
building partial delivery stations along an oil or gas transportation pipeline.

1.1 Previous Work


The L1 and L2 k-median and k-center problems in the plane are NP-hard [27],
and so as the L∞ k-center problem [15]. In the one-dimensional space, however,
both problems are solvable in polynomial time: For k-median, the best-known
algorithms run in O(nk) time [4,18] or in O(τ log n) time [11]; for k-center, the
best-known algorithms run in O(n log n) time [10,12,26].
The k-means problem in the plane is also NP-hard [24]. Heuristic and approx-
imation algorithms have been proposed, e.g., see [13,20,23,29].
The unweighted versions of the constrained k-center were studied before. The
L2 case was first proposed and solved in O(n log2 n) time by Brass et al. [6] and
later was improved to O(n log n) time by Karmakar et al. [21]. Algorithms of
O(n log n) time were also given in [6] for L1 and L∞ metrics; note that unlike
our results, even the points are given sorted, the above algorithms [6] still run
in O(n log n) time. In addition, Brass et al. [6] also gave interesting and efficient
algorithms for other two variations of the unweighted k-center problems, i.e.,
the line χ is not fixed but its slope is fixed, or χ is arbitrary. To the best of our
knowledge, we are not aware of any previous work on the weighted versions of
the constrained k-median and k-center problems studied in this paper.
Line-Constrained k-Median, k-Means, and k-Center Problems 5

Efficient algorithms have been given for other special cases. When k = 1,
Megiddo [25] solved the unweighted L2 1-center problem in O(n) time. Hurtado
[19] gave an O(n + m) time algorithm for the unweighted L2 1-center problem
with the center restricted in a given convex polygon of m vertices. For k =
2, Chan [7] proposed an O(n log2 n log2 log n) time for the unweighted L2 2-
center problem and another randomized algorithm; if the points are in convex
positions, the same problem can be solved in O(n log2 n) time [22]. The L2 1-
median problem is also known as the Weber problem and no exact algorithm is
known for it (and even for the constrained version) [5].
Alt et al. [3] studied a somewhat similar problem to our unweighted con-
strained problems, where the goal is to find a set of disks whose union covers all
points and whose centers must be on a given line such that the sum of the radii
of all disks is minimized, and they gave an O(n2 log n) time algorithm [3]. Note
that this problem is different from our k-median, k-means, or k-center problems.

1.2 Our Approaches


Suppose p1 , p2 , . . . , pn are the points of P ordered by increasing x-coordinate.
We discover an easy but crucial observation: for every problem studied in this
paper, there always exists an optimal solution in which the points of P “served”
by the same facility are consecutive in their index order.
For convenience of discussion, in the following paper we will refer to the
k-means problem as the k-median problem under the L22 metric.
Based on the above observation, for the constrained k-median, we propose
an algorithmic scheme that works for all metrics (i.e., L1 , L2 , L22 , and L∞ ), by
modeling the problem as finding a minimum weight k-link path in a DAG G.
Furthermore, we prove that the weights of the edges of G satisfy the concave
Monge property and thus efficient techniques [2,28] can be used. One challenging
problem for the scheme is that we need to design a data structure to compute any
graph edge weight (i.e., given any i and j with i ≤ j, compute the optimal objec-
tive value for the constrained 1-median problem on the points pi , pi+1 , . . . , pj ).
For the L22 metric (i.e., the k-means), we build such a data structure in O(n)
time that can answer each query in O(1) time. For the L∞ metric, we build such
a data structure in O(n log n) time that can answer each query in O(log2 n) time.
Combining this data structure with the above algorithmic scheme, we can solve
the L22 and L∞ cases. In addition, based on interesting observations, we give
another algorithm for the L∞ case that is faster than the above scheme for
a certain range of values of k. For the L1 metric, instead of using the above
algorithmic scheme, we reduce the problem to the one-dimensional k-median
problem and then the algorithms in [4,11,18] can be applied.
For the constrained k-center, to solve the L2 case, we generalize the O(n log n)
time algorithm in [21] for the unweighted version. In fact, similar approaches
can also solve the L1 and L∞ cases. However, since the algorithm uses Cole’s
parametric search [12], which is complicated and involves large constants and
thus is only of theoretical interest, we design another O(n log n) time algorithms
for the L1 and L∞ cases, without using parametric search.
6 H. Wang and J. Zhang

In addition, for the unweighted L1 and L∞ cases, due to the above crucial
observation, our linear time algorithm hinges on the following efficient data struc-
tures. With O(n) time preprocessing, for any query i ≤ j, we can solve in O(1)
time the constrained L1 and L∞ 1-median problems on the points pi , pi+1 , . . . , pj .
Note that our algorithms for the L2 and L22 metrics work for any arbitrary
line χ (but χ must be given as input). However, since the distances under L1
and L∞ metrics are closely related to the orientation of the coordinate system,
our algorithms for them only work for horizontal lines χ.
We introduce some notations and observations in Section 2. In Sections 3
and 4, we present our algorithms for the constrained k-median (including the
k-means) and k-center problems, respectively. Due to the space limit, all lemma
and theorem proofs are omitted and can be found in the full paper.

2 Preliminaries
For simplicity of discussion, we assume no two points in P have the same
x-coordinate. Let p1 , p2 , . . . , pn be the points of P ordered by increasing x-
coordinate. Define P (i, j) = {pi , pi+1 , . . . , pj } for any i ≤ j. For any 1 ≤ i ≤ n,
we also use xi , yi , and wi to refer to x(pi ), y(pi ), and w(pi ), respectively.
For any facility set Q and any point p, let d(p, Q) = minq∈Q d(p, q). For
any point p ∈ P , if d(p, Q) =  d(p, q) for some facility point q ∈ Q, then we
say p is “served” by q. We call p∈P [w(p) · d(p, Q)] and maxp∈P [w(p) · d(p, Q)]
the objective value of the k-median and k-center problems, respectively. The
following is an easy but crucial lemma.
Lemma 1. For each of the constrained k-median and k-center problems of any
metric (i.e., L1 , L2 , L22 , or L∞ ), there must exist an optimal solution in which
the points of P served by the same facility are consecutive in their index order.
For any i ≤ j, consider the constrained 1-median problem on P (i, j); denote
by f (i, j) the facility in an optimal solution and define α(i, j) to be the objective
j
value of the optimal solution, i.e., α(i, j) = t=i [wt ·d(pt , f (i, j))]. We call f (i, j)
the constrained median of P (i, j). In the case that f (i, j) is not unique, we let
f (i, j) refer to the leftmost such point. By Lemma 1, solving the constrained
k-median problem is equivalent to partitioning the sequence p1 , p2 , . . . , pn into k
subsequences such that the sum of the α values of all these subsequences is mini-
mized. There are also similar observations for the constrained k-center problem.
As will be seen later, these observations are quite useful for our algorithms.
For any point p on the x-axis, for convenience, we also use p to denote its
x-coordinate. For example, if two points p and q are on the x-axis, then p < q
means that p is strictly to the left of q. For any value x, we sometime also use x
to refer to the point on the x-axis with x-coordinate x.

3 The Constrained k-Median


This section gives our algorithms for the constrained k-median under L1 , L22 ,
and L∞ metrics. We first propose an algorithmic scheme in Section 3.1 that
Line-Constrained k-Median, k-Means, and k-Center Problems 7

d(pi , x)
pi

xi vi xi+1 xj vj xj+1 x Ii x

Figure 1. Illustrating an edge of G from vi to Figure 2. Illustrating the function


vj , i.e., the two (red) squared points d(pi , x): the (red) thick segment is Ii

works for any metric. To use the scheme, one has to design a data structure for
computing α(i, j) for any query i and j with i ≤ j. We solve the L22 case (i.e., the
k-means) by giving such a data structure in the end of Section 3.1. In Section
3.2, we design such a data structure for L∞ metric, and thus solves the L∞
case. In addition, we give another algorithm that is faster than the scheme for a
certain range of values of k. Instead of using the scheme, we get a better result
for the L1 case in Section 3.3 by reducing it to the one-dimensional problem.

3.1 An Algorithmic Scheme for All Metrics


In this subsection, unless otherwise stated, all notations involving distances, e.g.,
d(p, q), α(i, j), can use any distance metric (i.e., L1 , L2 , L22 , and L∞ ).
In light of our observations in Section 2, we will reduce the problem to finding
a minimum weight k-link path in a DAG G. Further, we will show that the edge
weights of G satisfy the concave Monge property and then efficient algorithms
[1,2,28] can be used. Below, we first define the graph G.
For each point pi ∈ P , recall that xi = x(pi ) and we also use xi to denote
the projection of pi on the x-axis. The vertex set of G consists of n + 1 vertices
v0 , v1 , . . . , vn and one can consider each vi corresponding to a point between xi
and xi+1 (v0 is to the left of x1 and vn is to the right of xn ); e.g., see Fig.1.
For any i and j with 0 ≤ i ≤ j ≤ n, we define a directed edge e(i, j) from vi to
vj , and the weight of the edge, denoted by w(i, j), is defined to be α(i + 1, j) (if
we view vi and vj as two points on the x-axis as above, then vi vj contains the
points xi+1 , xi+2 , . . . , xj ). Clearly, G is a directly acyclic graph (DAG).
A path in G is a k-link path if it has k edges. The weight of any path is the
sum of the weights of all edges of the path. A minimum weight k-link path from
v0 to vn in G is a k-link path that has the minimum weight among all k-link
paths from v0 to vn . Note that any k-link path from v0 to vn in G corresponds to
a partition of the points in P into k subsequences. According to our observations
in Section 2 and the definition of G, the following lemma is self-evident.
Lemma 2. A minimum weight k-link path π from v0 to vn in G corresponding to
an optimal solution OP T of the constrained k-median problem on P . Specifically,
the objective value of OP T is equal to the weight of π, and for each edge e(vi , vj )
of π, there is a corresponding facility serving all points of P (i + 1, j) in OP T .
Lemma 3. For any metric, the weights of the edges of G satisfy the concave
Monge property, i.e., w(i, j) + w(i + 1, j + 1) ≤ w(i, j + 1) + w(i + 1, j) holds for
any 1 ≤ i < j ≤ n.
8 H. Wang and J. Zhang

By Lemma 3, we can apply the algorithm in [1,2,28]. Assuming the weight of


each graph edge w(i, j) can be obtained in O(1) time, the algorithms in √ [2] and
[28] can compute √a minimum weight k-link path from v0 to vn in O(n k log n)
time and O(n2O( log k log log n) ) time, respectively. Further, as indicated in [2],
by using dynamic programming and applying the technique in [1], such a path
can also be computed in O(nk) time. In our problem, to compute each w(i, j) is
essentially to compute α(i + 1, j). Therefore, we can obtain the following result.

Theorem 1. For any metric, if we can build a data structure in O(T ) time
that can compute α(i, j) in O(σ) time for any query i ≤ j, then we can solve
the constrained k-median problem in O(T + σ · min{nk, τ }) time, where τ =
√ √
min{ nk log n, n2O( log k log log n) }.

The following result is an application of our algorithmic scheme in Theorem 1


to the L22 case (i.e., the k-means).

Theorem 2. For the L22 metric, a data structure can be built in O(n) time that
can answer each α(i, j) query in O(1) time. Consequently by Theorem 1 the
constrained k-means problem can be solved in O(min{nk, τ }) time.

3.2 The Constrained k-Median under the L∞ -Metric

In this section, all notations related to distances use the L∞ metric. We present
two algorithms. For the first algorithm, our main goal is to prove Lemma 4.
Thus, by Theorem 1, we can solve the L∞ case in O(min{nk, τ } · log2 n) time.

Lemma 4. For the L∞ metric, a data structure can be constructed in O(n log n)
time that can answer each α(i, j) query in O(log2 n) time.

For any point pi , let Ii denote the interval on the x-axis centered at xi with
length |yi | (i.e., the absolute value of the y-coordinate of pi ). Note that the points
of Ii have the same (L∞ ) distance to pi . Consider d(pi , x) as a function of a point
x on the x-axis. As x changes from −∞ to +∞, d(pi , x) first decreases and then
does not change when x ∈ Ii and finally increases (e.g., see Fig. 2). Consider
any two indices i ≤ j. Let E(i, j) be the set of the endpoints of all intervals It
j
for i ≤ t ≤ j. For any point x on the x-axis, define φ(i, j, x) = t=i wt d(pt , x).
By the definition of f (i, j), φ(i, j, x) is minimized at x = f (i, j) and α(i, j) =
φ(i, j, f (i, j)). Lemma 5 is crucial for computing α(i, j).

Lemma 5. The function φ(i, j, x) is a continuous piecewise linear function whose


slopes change only at the points of E(i, j). Further, there exist two points in E(i, j),
denoted by x and x with x ≤ x (x = x is possible), such that as x increases
from −∞ to +∞, φ(i, j, x) will strictly decrease when x ≤ x , and will be constant
when x ∈ [x , x ], and will strictly increase when x ≥ x .

By Lemma 5, to compute α(i, j), which is the minimum value of φ(x, i, j), we
can do binary search on the sorted list of E(i, j), provided that we can compute
Line-Constrained k-Median, k-Means, and k-Center Problems 9

φ(i, j, x) efficiently for any x. Since E(i, j) ⊆ E(1, n), we can also do binary
search on the sorted list of E(1, n) to compute α(i, j). Hence, as preprocessing,
we compute the sorted list of E(1, n) in O(n log n) time since |E(1, n)| = 2n.
According to the above discussion, for any query (i, j) with i ≤ j, if we
can compute φ(i, j, x) in O(σ  ) time for any x, then we can compute α(i, j) in
O(σ  log n) time. The following Lemma 6 gives a data structure for answering
φ(i, j, x) queries, which immediately leads to Lemma 4.
Lemma 6. We can construct a data structure in O(n log n) time that can com-
pute φ(i, j, x) in O(log n) time for any i ≤ j and x.
Proof. Let T be a complete binary tree whose leaves correspond to the points
of P from left to right. For each 1 ≤ i ≤ n, the i-th leaf is associated with
the function wi d(pi , x), which is actually φ(i, i, x). Consider any internal node
v. Let the leftmost (resp., rightmost) leaf of the subtree rooted at v be the i-th
(resp., j-th) leaf. We associate with v the function φ(i, j, x), and we also use
φv (x) to denote the function. By Lemma 5, the combinatorial complexity of the
function φv (x) is O(j − i + 1). Let u and w be v’s two children. Suppose we have
already computed the two functions φu (x) and φw (x); since essentially φv (x) =
φu (x) + φw (x), we can easily compute φv (x) in O(j − i + 1) time. Therefore, we
can compute the tree T in O(n log n) time in a bottom-up fashion.
Consider any query i ≤ j and x = x and the goal is to compute φ(i, j, x ).
By standard approaches, we first find O(log n) maximum subtrees such that
the leaves of these subtrees are exactly the leaves from the i-th leaf to the j-th
one. Let V be the set of the roots of these subtrees. Notice that φ(i, j, x ) =
  
v∈V φv (x ). For each v ∈ V , we can compute the value φv (x ) in O(log n)
time by doing binary search on the function φv (x) associated with v. In this
way, since |V | = O(log n), we can compute φ(i, j, x ) in overall O(log2 n) time.
We can avoid doing binary search on every node of V by constructing a fractional
cascading structure [8] on the functions φv (x) of the nodes of T . Using fractional
cascading, we only need to do one binary search on the root of T , and then the
values φv (x ) for all nodes v of V can be computed in constant time each. The
fractional cascading structure can be built in additional O(n log n) time [8].
As a summary, we can construct a data structure in O(n log n) time that can
compute φ(i, j, x) in O(log n) time for any i ≤ j and x. 
By Theorem 1 and Lemma 4, we can solve the constrained k-median problem
under L∞ metric in O(nk log2 n) or O(τ log2 n) time.
Our second algorithm is based on the following Lemma 7, which can be easily
proved based on Lemma 5.
Lemma 7. For the L∞ constrained k-median problem on P , there must exist
an optimal solution in which the facility set Q is a subset of E(1, n).
By Lemma 7, we have a set of “candidate” facilities, and further, by Lemma 1,
we only need to check these candidates from left to right. Based on these obser-
vations, we develop a dynamic programming algorithm and the result is given
in Lemma 8.
Another random document with
no related content on Scribd:
XVIII.
RELICS OF THE ARK.

We have already seen that Berosus relates how in his time portions
of the ark were removed, and used as amulets. Josephus says that
remains of the ark were to be seen at his day upon Ararat; and
Nicolas of Damascus reports the same. S. Epiphanius writes: “The
wood of the ark of Noah is shown to this day in the Kardæan (Koord)
country.”[261] And he is followed by a host of fathers. El Macin, in his
History of the Saracens, relates that the Emperor Heraclius visited
the relics after he had conquered the Persians, in the city of Thenia,
at the roots of Ararat. Haithon, the Armenian, declares that upon the
snows of Ararat a black speck is visible at all times: this is Noah’s
ark.[262] Benjamin of Tudela, in his Itinerary, says that all the wood
was carried away by the Caliph Omar, in A.D. 640, and was placed by
him in a temple or mosque he erected in an island formed by the
Tigris. One of the beams is shown in the Lateran at Rome. In 1670,
Johann Jansenius Strauss ascended to a hermit’s cell on the side of
Ararat, to bind up the cœnobite’s leg which was broken. The hermit’s
cell, said Strauss, was five days’ journey up the mountain, athwart
three clouds, and above a region of intolerable cold, in a calm warm
atmosphere. From the account of the hermit, Herr Strauss learnt that
the old man had dwelt there twenty-five years, and that he had felt
there neither rain nor winds. On the top of the mountain, fifteen
Italian miles from the cell, through the clear air, was distinguishable
the great vessel grounded in the snow. The hermit had reached it,
and of one of its planks had cut a cross, which he exhibited to the
German traveller.
In the town of Chenna, in Arabia Felix, says the traveller Prévoux, is
a large building, said to have been erected by Noah; and a large
piece of wood is exhibited through an iron grating, which is said to
have formed a portion of his ark. There is also to be seen at Chenna
a well, said to have been dug by the patriarch Jacob, of which the
water is icy cold.
The Armenians say that a certain monk, Jacob, once ascended
Ararat, and carried off a fragment of the ark, which he made
afterwards into a cross, and this is preserved amongst the sacred
relics of Etchmiadzin. When the Persian king, Abassus the Great,
sent to inquire about the ark, the monks replied that it was in vain for
him to attempt to reach it, on account of the precipices and glaciers,
and innumerable difficulties of the way.[263]
XIX.
CERTAIN DESCENDANTS OF HAM.

We shall follow certain Mussulman traditions for what follows. Ad,


son of Amalek, therefore grandson of Ham, established himself in
Arabia, where he became chief of the tribe of the Adites. He fell into
idolatry. He had two sons named Schedad and Schedéd, who
reigned over numerous subjects—one for two hundred and fifty, the
other for three hundred years. They built a superb city, where houses
were of sumptuous magnificence; the like of this city was never seen
before, nor will be seen again. This city vanished when the tribe of
the Adites was exterminated; as we shall relate when we give the
legends attaching to Heber. The commentators of the Koran tell
marvels of this wondrous city.
Under the Khalifate of Moawiyah, first of the Ommiades, an Arab of
the desert, named Kolabah, going in quest of his camel in the plain
of Aden, lighted on the gate of a beautiful city. He went in, but, being
filled with fear, he did not remain there more time than sufficed for
him to collect some of the stones of the street, and then he returned.
His neighbours, to whom he relates his adventure, repeated it to the
Khalif, who ordered Kolabah to be brought before him. The Arab
related frankly what he had seen, but Moawiyah would not give
credence to the marvellous tale, till he had consulted his learned
men, and especially the illustrious Al-Akhbar, who assured him that
the story of the poor Arab was worthy of all trust, for the city he had
seen was none other than that built by Schedad, son of Ad, in the
land of the Adites in which Aden is situated; and that, as the pride of
this prince knew no bounds, God had sent His angel to destroy all
the inhabitants, and conceal their splendid city from the eyes of men,
to be revealed only at intervals, that the memory of God’s judgment
might not fade out of men’s minds.
Schedad had a son named Dhohak, of whom strange tales are told.
He knew magic, and gained the sovereignty over the entire universe;
and he kept his subjects in terror by excessive cruelty. In the
Caherman-Nâmeh it is related that the Devil, satisfied with his
proceedings, offered him his services gratuitously, and they were
cheerfully accepted. The ferocity of the tyrant increased, he skinned
men alive, impaled and crucified them on the slightest charges.
After having served him five years, the Evil One thus addressed him:
“Sire! for many years I have been thy faithful attendant, neither have
I received of thee any recompense. Now I beseech of thee one
favour—that I may kiss thy shoulders.”
This favour was readily granted. Dhohak himself plucked off his
mantle to facilitate the kiss.
But no sooner had the Devil applied his lips to the two shoulders of
the tyrant, than two serpents, which could not be plucked off,
fastened there and began to gnaw his flesh.
Tabari says that the king bore on his shoulders two frightful ulcers or
cancers, resembling serpents’ heads, sent him by God as a
punishment for his crimes. These cancers caused him such acute
agony, that he shrieked night and day. No one was able to provide a
remedy or to abate the torment.
One night when he was asleep, some one appeared to him in a
dream, and said, “If you desire your ulcers to give less pain, apply to
them human brains.”
Next day, Dhohak awoke and ordered two men to be brought before
him; he slew them, cut open their skulls, extracted the brains and
applied them to his cancers. The relief was instantaneous, and
Dhohak felt, for the first time for many days, some hours of repose.
After this, every day two men were killed to form poultices for his
ulcers. During the two hundred latter years of the life of Dhohak, the
prisons were emptied to satisfy his requirement for fresh brains; and
when no more criminals could be procured, it was made a tribute for
his kingdom to render to him two men, each day, to be immolated to
soothe his pain.
Now there was at Ispahan a blacksmith, named Kaveh, who had two
beautiful sons, whom he loved more dearly than his own life. One
day they were seized, carried before the king, and his shoulders
were poulticed with their brains.
Kaveh was at work at his anvil when the news of the slaying of his
sons reached him. He deserted his anvil; and uttering a piercing cry,
he rushed into the streets, with his leathern apron before him, bitterly
lamenting his loss, and calling for vengeance on the monarch. The
people crowded about him, they plucked off his leather apron, and
converted it into a standard.
The crowd gathered as it advanced. From every street men flowed to
join the army, and shortly the blacksmith found himself at the head of
a hundred thousand men.
They marched to Demavend, where was the palace of the tyrant.
And Kaveh, before attacking it, thus addressed his soldiers, “I am not
one to lead you against a king; you need a king to make war against
a king.”
“Well,” said his followers, “we elect you to be our king.”
“I am but a simple blacksmith, and am not fit to rule,” answered
Kaveh, “but there is a royal prince named Afridoun, the son of
Djemschid, who has fled from the cruelty of Dhohak: choose him.”
They agreed. The prince was found and invested with the
sovereignty; then a battle was fought, and Dhohak’s army was
routed, and the tyrant was slain.
When Afridoun mounted the throne, he named Kaveh governor of
Ispahan. And when Kaveh was dead, the king asked his children to
give him their father’s leathern apron. Then, having obtained it, he
placed it among his treasures, and whenever he went to battle he
attached the smith’s apron to a tall staff, and marched under that
banner against his enemies.
In after years, this leathern apron was studded with precious stones,
till Omar, despising it, ordered the old piece of leather to be burnt;
but Yezdeguerd had already robbed it of its gems.[264]
Afridoun exercised the sovereignty during two hundred years. He
was the first to study astronomy, and he founded the science of
medicine. He was the first king to ride on an elephant. He had three
sons, Tur, Salm, and Irad. He loved the third son, Irad, more than the
two elder, and he gave him the sovereignty over Irad, Mosul, Koufa,
and Bagdad.
After the death of Afridoun, Tur and Salm marched against Irad,
defeated him and killed him, saying: “Our father has divided his
inheritance unjustly. He has given to Irad the best portion, the centre
of the world; as for us, we are cast out to its extremities.”
On the death of Tur and Salm, the crown left this family, and passed
to a king named Cush, who was of the sons of Ham, the son of
Noah. Cush reigned forty years. After him Canaan ascended the
throne. Cush and Canaan worshipped idols. It is said that Nimrod
was the son of Canaan. When Canaan died, Nimrod succeeded him.
Nimrod had a vizir named Azar (Terah), son of Nahor, son of
Sarough (Serug), who was sixth in generation from Noah. This Azar
was the father of Abraham, the friend of God.
From the time of the Deluge to the time of Abraham was three
thousand years. During that period, there was no prophet save Hud
(Eber), who was sent to the Adites, and Saleh, who was sent to the
Thamudites.
We shall relate the history of Hud and of Saleh, and then return to
that of Nimrod.[265]
XX.
SERUG.

“And Eber lived four and thirty years, and begat Peleg.
“And Peleg lived thirty years, and begat Reu. And Reu lived two and
thirty years, and begat Serug. And Serug lived thirty years, and
begat Nahor.”[266]
Serug is said to have discovered the art of coining gold and silver
money. In his days men erected many idols, into which demons
entered and wrought great signs by them. Samiri was king of the
Chaldees, and he discovered weights and measures and how to
weave silk, and also how to dye fabrics. He is related to have had
three eyes and two horns.
At the same time Apiphanus was king of Egypt. He built a ship, and
in it made piratical descents upon the neighbouring people living on
the shores of the Mediterranean Sea. He was succeeded by
Pharaoh, son of Saner, and the kings after him assumed his name
as their title.[267]
Nahor was the son of Serug. In the twenty-fifth year of his life, Job
the Just underwent his trial, according to the opinion of Arudha the
Canaanite. At that time Armun, king of Canaan, built the two cities
Sodom and Gomorrah, and called them after the names of his two
sons; but Zoar he named after his mother. At the same time, Murk or
Murph, king of Palestine, built Damascus.[268]
XXI.
THE PROPHET EBER.

“Unto Shem, the father of all the children of Eber, the brother of
Japheth the elder, even to him were children born.
“The children of Shem;—Elam, and Asshur, and Arphaxad, and Lud,
and Aram.
“And the children of Aram;—Uz, and Hul, and Gether, and Mash.
“And Arphaxad begat Salah; and Salah begat Eber.”[269]
According to some Mussulman writers, Oudh (Lud), the son of
Shem, had a son named Ad; but, according to others, Ad was the
son of Aram, son of Shem.
The tribes of Ad and Thamud lived near one another in the desert of
Hedjaz, in the south of Arabia. The land of the people of Ad was
nearer Mecca than the valley of Hidjr, and the valley of Hidjr is
situated at the extremity of the desert on the road to Syria.
Never in all the world were there such great and mighty men as the
Adites. Each of them was twelve cubits high, and they were so
strong that if any of them stamped on the ground he sank up to his
knees.
The Adites raised great monuments in the land which they inhabited.
Wherever these Cyclopean edifices exist, they are called by the
Arabs the constructions of the Adites.
God ordered the prophet Hud (Eber) to go to the Adites and preach
to them the One true God, and turn them from idolatry. But the
Adites would not hearken to his words, and when he offered them
the promises of God, they said, “What better dwellings can He give
us than those which we have made?” And when he spoke to them of
God’s threatenings, they mocked and said, “Who can resist us who
are so strong?”
For fifty years did the prophet Hud speak to the Adites, and their
reply to his exhortations is preserved in the Koran, “O Hud, you
produce no evidence of what you advance; we will not abandon our
gods because of your preaching. We mistrust your mission. We
believe that one of our gods bears a hatred against you.”
Hud replied, “I take God to witness, and you also be witnesses, that I
am innocent of your polytheism.”[270]
The words of the Adites, “We believe that one of our gods bears a
hatred against thee,” signified that they believed one of their gods
had driven him mad.
During the fifty years that Hud’s mission lasted, the Adites believed
neither in God nor in the prophet, with the exception of a very few,
who believed in secret.
At the end of that time God withheld the rain from heaven, and
afflicted the Adites with drought. All the cattle of Ad died, and the
Adites fainted for lack of water. For three years no rain fell.
Hud said to the Adites, “Believe in God, and He will give you rain.”
They replied, “Thou art mad.” But they chose three men to send to
Mecca with victims; for the infidels believe in the sanctity of Mecca,
though they believe not in the One true God.
But Eber said, “Your sacrifices will be unavailing, unless you first
believe.”
The three deputies started for Mecca with many camels, oxen, and
sheep, as sacrifices. And when they reached Mecca they made
friends with the inhabitants of that city, and were received with
hospitality. They passed their days and nights in eating and drinking
wine, and in their drunkenness they forgot their people, and the
mission on which they had been sent. The inhabitants of Mecca
ordered musicians to sing the afflictions of the Adites, to recall to the
envoys the purpose of their visit. Then Lokman and Morthed, two of
the deputies, declared to Qaïl, the third, that they believed in Allah;
and they added, “If our people had believed the words of the prophet
Hud, they would not have suffered from drought,” and Lokman and
Morthed were not drunk when they said these words.
Qaïl replied, “You do not partake in the affliction of our nation. I will
go myself and will offer the victims.”
He went and led the beasts to the top of a mountain to sacrifice
them, and turning his face to heaven, he said, “O God of heaven,
hearken unto my prayer, and send rain on my poor afflicted people.”
Instantly there appeared three clouds in the blue sky: one was red,
one was black, the third was white; and a voice issued from the
clouds, saying, “Choose which shall descend upon thy people.”
Then Qaïl said within himself, “The white cloud, if it hung all day over
my nation, would not burst in rain; the red cloud, if it hung over them
night and day, would not drop a shower; but the black cloud is heavy
with water.” So he chose the black cloud.
And a voice cried, “It is gone to fall upon thy people.”
Qaïl returned full of joy, thinking he had obtained rain; but that cloud
was big with the judgments of God. Qaïl told what he had done to his
companions, Lokman and Morthed, but they laughed at him.
Now the cloud, when it arrived over the land of Ad, was
accompanied by a wind. And the Adites looked up rejoicing, and
cried, “The rain, the rain is coming!”
Then the cloud gaped, and a dry whirlwind rolled out from it, and
swept up all the cattle that were in the land, and raised them in the
air, spun them about, and dashed them lifeless on the ground.
But the Adites said, “Fear not; first comes wind, then comes rain.”
And they rushed out of their houses into the fields. Hud thought they
were coming forth to ask his assistance; but they sought him not.
Then the whirlwind caught them up and cast them down again. Now
each of these men was like a palm-tree in stature, and they lay
shattered and lifeless on the sand.
Hud was saved, along with those who had believed his word.
Now when the envoys at Mecca heard what had befallen their
people, they went all three to the summit of the mountain, and
Lokman and Morthed said to Qaïl, “Believe.” But he answered,
raising his face and hands to heaven: “O God of heaven, if thou hast
destroyed my people, slay me also.”
Then the whirlwind came, and rushed on him, and caught him up
and cast him down, and he was dead.
But Lokman and Morthed offered their sacrifice, and a voice from
heaven said, “What is your petition?”
Lokman answered: “O Lord, grant me a long life, that I may outlive
seven vultures.” Now a vulture is the longest-lived of all birds; it lives
five hundred years.
And the voice replied, “However long thy life may be, death will close
it.”
Lokman said, “I know; that is true.”
Then his prayer was granted. And Lokman took a young vulture and
fed it for five hundred years, and it died; then he took a second, and
at the expiration of five hundred years it died also; and so on till he
had reached the age of three thousand five hundred years, and then
he died also.
Morthed made his request, and it was, “O Lord, give me wheat
bread,” for hitherto in Ad he had eaten only barley bread. So Allah
gave Morthed so much wheat, that he was able to make bread
thereof all the rest of his life.
Hud lived fifty years with the faithful who had received his doctrine,
and his life in all was one hundred and fifty years. The prophet Saleh
appeared five hundred years after Hud; he was sent to the
Thamudites.[271]
But there is another version of the story given by Weil.
Hud promised Schaddad, king of the Adites, a glorious city in the
heavens, if he would turn to the true God. But the king said, “I need
no other city than that I have built. My palace rests on a thousand
pillars of rubies and emeralds; the streets and walls are of gold, and
pearl, and carbuncle, and topaz; and each pillar in my house is a
hundred ells long.”
Then, at Hud’s word, God let the city and palace of Schaddad fade
away like a dream of the night, and storm and rain descended, and
night fell, and the king was without home in the desert.[272]
Of Lokman we must relate something more. He was a great prophet;
some say he was nephew of Job, whose sister was his mother;
others relate that he was the son of Beor, the son of Nahor, the son
of Terah.
One day, whilst he was reposing in the heat of the day, the angels
entered his room and saluted him, but did not show themselves.
Lokman heard their voices, but saw not their persons. Then the
angels said to him,—
“We are messengers of God, thy Creator and ours; He has sent us
unto thee to announce to thee that thou shalt be a great monarch.”
Lokman replied, “If God desires what you say, His will can
accomplish all things, and doubtless He will give me what is
necessary for executing my duty in that position in which He will
place me. But if He would suffer me to choose a state of life, I should
prefer that in which I now am,”—now Lokman was a slave,—“and
above all would I ask Him to enable me never to offend Him; without
which all earthly grandeur would be to me a burden.”
This reply of Lokman was so pleasing to Allah, that He gave him the
gift of wisdom to such a degree of excellence, that he became
capable of instructing all men; and this he did by means of a great
multitude of maxims, sentences, and parables to the number of ten
thousand, each of which is more valuable than the whole world.[273]
When Lokman did not know anything with which others were
acquainted, he held his tongue, and did not ask questions and thus
divulge his ignorance.
As he lived to a great age, he was alive in the days of King David.
Now David made a coat of mail, and showed it to Lokman. The sage
had seen nothing like it before, and did not know what purpose it
was to serve, but he looked knowing and nodded his head. Presently
David put the armour upon him, and marched, and said, “It is
serviceable in war.” Then Lokman understood its object; so his
mouth became unsealed and he talked about it.
Lokman used to say, “Silence is wisdom, but few practise it.”[274]
Thalebi relates, in his Commentary on the Koran, that Lokman was a
slave, and that having been sent along with other slaves into the
country to gather fruit, his fellow-slaves ate them, and charged
Lokman with having done so. Lokman, to justify himself, said to his
master, “Let every one of us slaves be given warm water to drink,
and you will soon see who has been the thief.”
The expedient succeeded; the slaves who had eaten the fruit
vomited it, and Lokman threw up only warm water.
The same story precisely is told of Æsop.
Lokman is always spoken of as black, with thick lips. He is regarded
by the Arabs much as is Bidpay by the Indians, and Æsop by the
Europeans, as the Father of Fable.
XXII.
THE PROPHET SALEH.

The prophet Saleh was the son of Ad, son of Aram, son of Shem,
and is not to be confused with Saleh, son of Arphaxad.
The Mussulmans say that he was sent to convert the Thamudites.
The Thamudites were in size and strength like their brethren the
Adites, but they inhabited the rocks, which they dug out into
spacious mansions. They had in the midst of their land an unfailing
supply of sweet and limpid water. They were idolaters. Saleh came
armed with the command of Allah to these men, and he preached to
them that they should turn from the worship of stocks and stones to
that of the living God who made them.
Now Saleh had been born among the Thamudites, but he had never
been an idolater. When he was young, the natives of the land had
laughed at him, and said, “He is young and inexperienced; when he
is old, and has grown wiser, he will adore our gods.”
When Saleh grew old, he forbade the Thamudites to worship idols,
and he spoke to them of the true and only God.
But they said, “What miracle can you work, to prove that your
mission is from God?”[275]
Then he said, “Oh, my people, a she-camel that shall come from
God shall be to you for a sign. Let her go and eat on the earth, and
do her no injury, that a terrible retribution fall not upon you.”[276]
Now Saleh had asked them what miracle they desired, and they had
answered, “Bring out of the rock a camel with red hair, and a colt of a
camel also with red hair; let them eat grass, and we will believe.”
Saleh said to them, “What you ask is easy,” and he prayed.
Then the rock groaned and clave asunder, and there came out a
she-camel with her foal, and their hair was red, and they began to
eat grass.
Then the Thamudites exclaimed, “He is a magician!” and they would
not believe in him.
The camel went to the perpetual fountain, and she drank it up, so
that from that day forward from their spring they could get no water,
and they suffered from thirst.
The Thamudites went to Saleh and said, “We need water!”
Saleh replied, “The fountain shall flow one day for you, and one day
for the camel.”
So it was agreed that the camel should drink alternate days with the
people of the land, and that alternate days each should be without
water whilst the other was drinking.
Then Saleh said, for he saw that the people hated the camel and her
foal, “Beware that you slay not these animals, for the day that they
perish, great shall be your punishment.”
The she-camel lived thirty years among the Thamudites, but God
revealed to Saleh that they were bent on slaying the camel, and he
said, “The slayer will be a child with red hair and blue eyes.”
Now the Thamudites ordered ten midwives to attend on the women
in their confinement, and if a child were born with the signs indicated
by the prophet, it was to be destroyed instantly.
Nine children had thus been killed, and the parents conceived a
deadly animosity against Saleh the prophet, and formed a design to
slay him.
One of the chiefs among the Thamudites had a son born to him with
red hair and blue eyes, and the nurses would have destroyed it, but
the nine men spake to the father of the child, and they banded
together, and saved the infant.
Now when this child had attained the age of eleven, he became
great and handsome; and each of the parents whose children had
been put to death, when he saw him, said, “Such an one would have
been my son, had not he been slain at the instigation of Saleh.” And
they combined to put the prophet to death. They said among
themselves, “We will kill him outside the city, and returning, say we
were elsewhere when he was murdered.”
Having formed this project, they left the city and placed themselves
under a rock, awaiting his exit from the gates. But God commanded
the rock, and it fell and crushed them all.
Next day their corpses were recovered, but the Thamudites were
very wroth, and said, “Saleh has slain our children, and now he slays
our men;” and they added, “We will be revenged on his camel.”
But no one could be found to undertake the execution of this deed,
save the red-haired child. He went to the fountain where the camel
was drinking, and with one kick he knocked her over, and with
another kick he despatched her.
But the foal, seeing the fate of her mother, ran away, and the boy
with the red hair and blue eyes ran after her.
Saleh, seeing what had taken place, cried, “The judgment of God is
about to fall.”
The people were frightened, and asked, “What shall we do?”
“The judgment of God will not fall as long as the colt remains among
you.”
Hearing this, the whole population went in pursuit of the young
camel. Now it had fled to the mountain whence it had sprung, and
the red-haired boy was close on its heels. And when the young
camel heard the shouting of the inhabitants of the city, and saw the
multitude in pursuit, it stood before the rock, turned round, uttered
three piercing cries, and vanished.
The Thamudites arrived and beat the rock, but they could not open
it. Then said Saleh, “The judgment of God will fall; prepare to receive
it. The first day your faces will become livid, the second day they will
become black, and the third day red.”
Things happened as Saleh had predicted. And when the signs befel
them which Saleh had foretold, they knew that their end was near.
The first day they became ash pale, the second day coal black, and
the third day red as fire, and then there came a sound from heaven,
and all fell dead on the earth, save Saleh and those who believed in
him; these heard the sound, but did not perish.
By the will of God, when the people were destroyed, one man was
absent at Mecca; the name of this man was Abou-Ghalib. When he
knew what had befallen his nation, he took up his residence in
Mecca; but all the rest perished, as it is written in the Koran, “In the
morning they were found dead in their houses, stretched upon the
ground, as though they had never dwelt there.”
From Saleh to Abraham there was no prophet. At the time of that
patriarch there was no king over all the earth. The sovereignty had
passed to Canaan, the son of Cush, the son of Ham, who was the
son of Noah.[277]
The camel of the prophet Saleh was placed by Mohammed in the
heavens, together with the ass of Balaam, and other favoured
animals.
Now wonderful as is this story, it is surpassed by that related by
certain Arabic historians of the mission of Saleh. This we proceed to
give.
Djundu Ibn Omar was king of the Thamudites, a people numbering
seventy thousand fighting men. He had a palace cut out of the face
of a rock, and his high priest, Kanuch Ibn Abid, had one likewise.
The most magnificent building in the city was a temple which
contained the idol worshipped by the people. This idol had the head
of a man, the neck of a bull, the body of a lion, and the feet of a
horse. It was fashioned out of pure gold, and was studded with
jewels.
One day, as Kanuch, the high priest, was worshipping in the temple,
he fell asleep, and heard a voice cry, “The truth will appear, and the
madness will pass away.” He started to his feet in alarm, and saw
the idol prostrate on the floor, and its crown had fallen from its head.
Kanuch cried out for assistance, and fled to the king, who sent men
to set up the image, and replace on its head the crown that had
fallen from it.
But doubt took possession of the heart of Kanuch; he no longer
addressed the image in prayer, and his enthusiasm was at an end.
The king observed this, and sent two vizirs with orders to imprison
and execute him. But Allah struck the vizirs with blindness, and he
sent two angels to transport Kanuch to a well-shaded grotto, well
supplied with all that could content the heart of man.
As Kanuch was nowhere to be found, the king appointed his
kinsman Davud to be high priest. But on the third day he came to the
king to announce to him that the idol was again prostrate.
The monarch set it up once more, and Eblis, entering the image,
spoke through its mouth, exhorting all men to beware of novel
doctrines which were about to be introduced.
Next feast-day Davud was about to sacrifice two oxen to the idol,
when one of them opened its mouth, and thus addressed him:—
“Will you sacrifice creatures endued with life by the living God to a
mass of lifeless metal? O God, do Thou destroy this sinful nation!”
And the oxen broke their halters, and ran away.
Horsemen were deputed to pursue and capture them, but they
escaped, for Allah screened them.
But God in His mercy resolved to give the Thamudites another
chance of repenting of their idolatry.
Raghwah, Kanuch’s wife, had shed incessant tears since the
disappearance of her husband. Allah dispatched a bird out of
Paradise to guide her to the grotto of Kanuch.
This bird was a raven; its head was white as snow, its back was
green as emerald. Its feet were purple; its beak of heaven’s blue. Its
eyes were gems; only its body was black, for this bird did not fall
under the curse of Noah, as it was in Paradise.
It was midnight when the raven entered Raghwah’s dark chamber,
where she lay weeping on a carpet; but the glory of its eyes illumined
the whole room, as though the sun had suddenly flashed into it.
Raghwah rose from her place, and gazed in wonder on the lovely
bird, which opened its beak and said, “Arise and follow me! God has
seen thy tears, and will reunite thee to thy husband.”
Raghwah followed the raven, which flew before her, and with the
light of its eyes turned the night into day. The morning star had not
risen, when they stood before Kanuch’s grot. Then cried the raven,
“Kanuch, open to thy wife!” and so vanished.
Nine months after that Raghwah had rejoined her husband, she bore
him a son, who was the image of Seth, and had on his brow the
prophetic light; and Kanuch, in the hope of drawing him to the
knowledge of the true God and to a pious life, gave him the name of
Saleh (The Blessed).
Not long after Saleh’s birth, Kanuch died; and the raven of Paradise
returned to the grotto to lead back Saleh to his own people.
Saleh grew in beauty and strength, to the admiration of his mother
and all who saw him.
A war was being waged between the descendants of Ham and the
Thamudites, and the latter had lost many battles and a large portion
of their army, when Saleh suddenly appeared in the battle-field at the
head of a few friends, and, by his personal heroism, turned the tide
of victory, and routed the enemy.
This success drew upon him the gratitude and love of the people, but
the envy of the king was kindled, and he sought the life of the young
prophet. But as often as assassins were sent by the king to take his
life, their arms shrivelled up, and were only restored at the
intercession of Saleh. These circumstances tended to increase and
confirm the number of his adherents, so that he was able to build a
mosque, and occupy with worshippers of the true God one whole
quarter of the city.
But one day the king surrounded the mosque with his troops, and
threatened Saleh and his followers with death if they would not work
a miracle to prove their worship to be the true one.
Saleh prayed, and instantly the leaves of the date-tree that stood
before the mosque were transformed into serpents and scorpions,
which fell over the king and his soldiers; whilst two doves, which
dwelt on the terrace of the mosque, sang aloud, “Believe in Saleh,
he is a prophet and messenger of God!”
But Saleh was moved with compassion when he saw the anguish of
those who had been bitten by the scorpions and vipers, and he
prayed to God, and the noxious reptiles were transformed back
again into date-leaves, and those who had been stung were made
whole. Nevertheless the king hardened his heart, and continued to
worship false gods.
When Saleh saw the impenitence of the Thamudites, he besought
God to destroy them; but an angel appeared to him in a cave, and
sent him to sleep for twenty years.
When he woke he betook himself towards the mosque he had built,
never doubting that he had slept but a single night. The mosque was
gone, his friends and adherents were dead or dispersed, a few
remained, but they were old, and he hardly recognized them. Falling
into despair, the angel Gabriel came to him and said,—
“Thou wert hasty in desiring the destruction of this people, therefore
God hath withdrawn from thy life twenty years, which He has taken
from thee in sleep. Now He sends thee precious relics wherewith to
establish thy mission, to wit, Adam’s shirt, Abel’s sandals, Seth’s
overcoat, Enoch’s seal ring, Noah’s sword, and Hud’s staff.”
Next day, as the king Djundu with his brother Schihab, and the
priests and the princes of the people, formed a procession to an idol
temple near the town, Saleh ran before the procession, entered the
temple, and stood in the door.
“Who art thou?” asked the king in astonishment: for he did not
recognize Saleh, so greatly had God changed him in his sleep of
twenty years.
He answered: “I am Saleh, the messenger of the only God, who
preached to you twenty years ago, and showed to you many signs

You might also like