PQ tree

A PQ tree is a tree-based data structure that represents a family of permutations on a set of elements, discovered and named by Kellogg S. Booth and George S. Lueker in 1976.[1] It is a rooted, labeled tree, in which each element is represented by one of the leaf nodes, and each non-leaf node is labelled P or Q. A P node has at least two children, and a Q node has at least three children.

A PQ tree represents its permutations via permissible reorderings of the children of its nodes. The children of a P node may be reordered in any way. The children of a Q node may be put in reverse order, but may not otherwise be reordered. A PQ tree represents all leaf node orderings that can be achieved by any sequence of these two operations. A PQ tree with many P and Q nodes can represent complicated subsets of the set of all possible orderings. However, not every set of orderings may be representable in this way; for instance, if an ordering is represented by a PQ tree, the reverse of the ordering must also be represented by the same tree.

PQ trees are used to solve problems where the goal is to find an ordering that satisfies various constraints. In these problems, constraints on the ordering are included one at a time, by modifying the PQ tree structure in such a way that it represents only orderings satisfying the constraint. Applications of PQ trees include creating a contig map from DNA fragments,[2] testing a matrix for the consecutive ones property, recognizing interval graphs, and determining whether a graph is planar.[1]

Examples and notation

The PQ tree representing
[1 (2 3 4) 5]

If all the leaves of a PQ tree are connected directly to a root P node then all possible orderings are allowed. If all the leaves are connected directly to a root Q node then only one order and its reverse are allowed. If nodes a,b,c connect to a P node, which connects to a root P node, with all other leaf nodes connected directly to the root, then any ordering where a,b,c are contiguous is allowed.

Where graphical presentation is unavailable PQ trees are often noted using nested parenthesized lists. Each matched pair of square parentheses represents a Q node and each matched pair of rounded parentheses represent a P node. Leaves are non-parentheses elements of the lists. The image on the left is represented in this notation by [1 (2 3 4) 5]. This PQ tree represents the following twelve permutations on the set {1, 2, 3, 4, 5}:

12345, 12435, 13245, 13425, 14235, 14325, 52341, 52431, 53241, 53421, 54231, 54321.

PC trees

The PC tree, developed by Wei-Kuan Shih and Wen-Lian Hsu, is a more recent generalization of the PQ tree. Like the PQ tree, it represents permutations by reorderings of nodes in a tree, with elements represented at the leaves of the tree. Unlike the PQ tree, the PC tree is unrooted. The nodes adjacent to any non-leaf node labeled P may be reordered arbitrarily as in the PQ tree, while the nodes adjacent to any non-leaf node labeled C have a fixed cyclic order and may only be reordered by reversing this order. Thus, a PC tree can only represent sets of orderings in which any circular permutation or reversal of an ordering in the set is also in the set. However, a PQ tree on n elements may be simulated by a PC tree on n + 1 elements, where the extra element serves to root the PC tree. The data structure operations required to perform a planarity testing algorithm on PC trees are somewhat simpler than the corresponding operations on PQ trees.[3]

See also

References

  1. ^ a b Booth, Kellogg S.; Lueker, George S. (1976). "Testing for the consecutive ones property, interval graphs, and graph planarity using PQ-tree algorithms". Journal of Computer and System Sciences. 13 (3): 335–379. doi:10.1016/S0022-0000(76)80045-1.
  2. ^ Karp, Richard M. (1993). "Mapping the genome: some combinatorial problems arising in molecular biology". In Kosaraju, S. Rao; Johnson, David S.; Aggarwal, Alok (eds.). Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing, May 16-18, 1993, San Diego, CA, USA. Association for Computing Machinery. pp. 278–285. doi:10.1145/167088.167170.
  3. ^ Shih, Wei-Kuan; Hsu, Wen-Lian (1999). "A new planarity test" (PDF). Theoretical Computer Science. 223 (1–2): 179–191. doi:10.1016/S0304-3975(98)00120-0.

Read other articles:

Catholic religious order This article is about the Catholic religious order. For other uses, see Trinitarian (disambiguation). Order of the Holy Trinity redirects here. For the Ethiopian house order, see Order of the Holy Trinity (Ethiopia). TrinitariansOrder of the Most Holy Trinity and of the CaptivesLatin: Ordo Sanctissimae Trinitatis et CaptivorumFlag of the TrinitariansMosaic of Jesus Christ used as the emblem of the TrinitariansAbbreviationOSsTNicknameTrinitariansFormation17 December 11...

 

 

Avilly-Saint-LéonardAvilly-Saint-Léonard Lokasi di Region Hauts-de-France Avilly-Saint-Léonard Koordinat: 49°11′41″N 2°32′14″E / 49.1947222222°N 2.53722222222°E / 49.1947222222; 2.53722222222NegaraPrancisRegionHauts-de-FranceDepartemenOiseArondisemenSenlisKantonSenlisAntarkomuneCommunauté de communes de l'aire cantiliennePemerintahan • Wali kota (2008–2014) Amédée BussiereLuas • Land111,96 km2 (462 sq mi) ...

 

 

Gurney BayTeluk Gurneycode: ms is deprecated  (Melayu) கர்னி விரிகுடாcode: ta is deprecated  (Tamil)Gurney Bay as of October 2023JenisTaman kotaLokasiGurney Drive, George Town, Pulau Pinang, MalaysiaKoordinat5°26′19.7046″N 100°18′53.2363″E / 5.438806833°N 100.314787861°E / 5.438806833; 100.314787861Koordinat: 5°26′19.7046″N 100°18′53.2363″E / 5.438806833°N 100.314787861°E / 5.438806833;...

American basketball coach and player Norm StewartStewart from The Savitar, 1969Biographical detailsBorn (1935-01-20) January 20, 1935 (age 89)Shelbyville, Missouri, U.S.Playing careerBasketball1953–1956Missouri1956–1957St. Louis HawksBaseball1954–1956Missouri1957Aberdeen Pheasants Position(s)Forward (basketball)Pitcher (baseball)Coaching career (HC unless noted)Basketball1957–1961Missouri (assistant)1961–1967State College of Iowa1967–1999MissouriBaseball1957–1961Missouri (a...

 

 

مسجد ظلمات وضريح مير عمادمعلومات عامةنوع المبنى مسجد وضريحالمنطقة الإدارية أصفهان البلد  إيرانالصفة التُّراثيَّةتصنيف تراثي المعالم الوطنية الإيرانية[1] (1934 – ) معلومات أخرىالإحداثيات 32°40′N 51°41′E / 32.66°N 51.68°E / 32.66; 51.68 تعديل - تعديل مصدري - تعديل ويكي بيا...

 

 

Košice-okolie District in the Kosice Region Mudrovce (Slovak pronunciation: [ˈmudrɔwtse]; Hungarian: Modrafalva) is a village and municipality in Košice-okolie District in the Kosice Region of eastern Slovakia. History In historical records the village was first mentioned in 1406. Geography The village lies at an altitude of 410 metres and covers an area of 5.889 km². The municipality has a population of only 84 people. External links [1] vteMunicipalities of Košice–okoli...

Miss IndonesiaLogo Miss IndonesiaTanggal pendirian2005TipeKontes kecantikanKantor pusat JakartaLokasi IndonesiaJumlah anggota Miss World(2006-sekarang)Miss ASEAN (2005)Bahasa resmi IndonesiaChairwoman and FounderLiliana TanoesoedibjoTokoh pentingMartha TilaarWulan TilaarLina PriscillaSitus webwww.missindonesia.co.id Miss Jawa Tengah adalah sebuah gelar yang didapat bagi perwakilan provinsi Jawa Tengah di ajang Miss Indonesia. Pemegang titel saat ini adalah Angelique Tiara dari Semarang y...

 

 

Эту страницу предлагается объединить со страницей Верхний, нижний, свитч (БДСМ).Пояснение причин и обсуждение — на странице Википедия:К объединению/28 апреля 2023.Обсуждение длится не менее недели (подробнее). Не удаляйте шаблон до подведения итога обсуждения. Эта статья ...

 

 

Statistics of the U.S. Bureau of Labor Statistics The annual percent change in the US Consumer Price Index for All Urban Consumers is one of the most common metrics for price inflation in the United States. The United States Consumer Price Index (CPI) is a family of various consumer price indices published monthly by the United States Bureau of Labor Statistics (BLS). The most commonly used indices are the CPI-U and the CPI-W, though many alternative versions exist for different uses. For exa...

Mammalian protein found in Homo sapiens Mevalonate KinaseCrystallographic structure of mevalonate kinase from Staphylococcus aureus.[1]IdentifiersEC no.2.7.1.36CAS no.9026-52-2 DatabasesIntEnzIntEnz viewBRENDABRENDA entryExPASyNiceZyme viewKEGGKEGG entryMetaCycmetabolic pathwayPRIAMprofilePDB structuresRCSB PDB PDBe PDBsumGene OntologyAmiGO / QuickGOSearchPMCarticlesPubMedarticlesNCBIproteins MVKAvailable structuresPDBOrtholog search: PDBe RCSB List of PDB id codes2R3VIdentifiersAlias...

 

 

Come to Mama redirects here. For the Lady Gaga song, see Come to Mama (Lady Gaga song). 1985 studio album by Pete TownshendWhite City: A NovelStudio album by Pete TownshendReleased11 November 1985 (1985-11-11)RecordedNovember 1984 – July 1985Studio Eel Pie Studios, Twickenham Eel Pie Studios, Soho AIR, London GenreRockpop rockLength38:27LabelAtco (US)ProducerChris ThomasPete Townshend chronology Scoop(1983) White City: A Novel(1985) Deep End Live!(1986) Singles from W...

 

 

Ongoing COVID-19 viral pandemic in Liechtenstein This article needs to be updated. Please help update this article to reflect recent events or newly available information. (December 2020) You can help expand this article with text translated from the corresponding article in German. (February 2021) Click [show] for important translation instructions. View a machine-translated version of the German article. Machine translation, like DeepL or Google Translate, is a useful starting point fo...

AK-102 Jenis Senapan serbu Negara asal  Rusia Sejarah pemakaian Digunakan oleh Indonesia, Bhutan Malaysia, Pakistan, Somalia, Uruguay, India, Venezuela, Cyprus, Uni Emirat Arab Sejarah produksi Perancang Mikhail Kalashnikov Tahun 1994 Varian AK-104, AK-105 Spesifikasi Berat 30 kg (66,1 pon) tanpa magazen Panjang 824 mm (32.44 in) popor dibuka / 586 mm (23.1 in) popor dilipat Panjang laras 314 mm (12.36 in) Peluru 5,56 x 45 mm NATO Mekanisme Gas-actuated, rotatin...

 

 

Video game character Fictional character Mega ManMega Man characterArtwork of Mega Man from Mega Man X DiVEFirst appearanceMega Man (1987)Created byAkira KitamuraDesigned byAkira KitamuraKeiji InafuneVoiced by English Doug Parker(Captain N: The Game Master)Ian James Corlett(MM 1994 TV series)Gregory Smith(MM: Upon a Star)Ruth Marie Jarman (MM8)[1]Cole Howard(MMPU)[2]Chris Cason(Street Fighter X Tekken)[2]Benjamin Diskin(MM11)[2]Vincent Tong(MM: Fully Charged) J...

 

 

120UbnUnbiniliumKonfigurasi elektron unbinilium Sifat umumPengucapan/unbinilium/ Nama alternatifunsur 120, eka-radiumUnbinilium dalam tabel periodik 120Ubn Hidrogen Helium Lithium Berilium Boron Karbon Nitrogen Oksigen Fluor Neon Natrium Magnesium Aluminium Silikon Fosfor Sulfur Clor Argon Potasium Kalsium Skandium Titanium Vanadium Chromium Mangan Besi Cobalt Nikel Tembaga Seng Gallium Germanium Arsen Selen Bromin Kripton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Tech...

CelanoD'azzurro alla banda d'oro.Stato Italia Casata di derivazioneConti dei Marsi Titoli Conti Baroni FondatoreOderisio di Ocre Ultimo sovranoJacovella da Celano Data di fondazioneXII secolo Data di estinzioneante 1471 Confluita inAccrocciamuro EtniaItaliana Manuale La famiglia Celano (talvolta preceduta dalla preposizione da) è stata una famiglia nobile italiana[1]. Fu una delle sette grandi casate del Regno di Napoli[2]. Indice 1 Storia 2 Albero genealogico 3 Feudi 4 ...

 

 

Football tournament season 1876–77 Scottish CupThe Scottish Cup trophyTournament detailsCountryScotlandTeams81Defending championsQueen's ParkFinal positionsChampionsVale of Leven(first title)Runner-upRangersTournament statisticsMatches played88Goals scored280 (3.18 per match)← 1875–761877–78 → The 1876–77 Scottish Cup – officially the Scottish Football Association Challenge Cup – was the fourth season of Scotland's most prestigious football kn...

 

 

В Википедии есть статьи о других людях с фамилией Шпагин. Георгий Семёнович Шпагин Депутат Верховного совета СССР 10 февраля 1946 — 12 марта 1950 Рождение 17 (29) апреля 1897(1897-04-29)Клюшниково,Ковровский уезд,Владимирская губерния, Российская империя Смерть 6 февраля 1952(1952-02-06) (54 �...

Rugby league team season 2015 Widnes Vikings seasonSuper League XX Rank9thPlay-off result2ndChallenge CupQuarter-final2015 recordWins: 15; draws: 1; losses: 16Points scoredFor: 796; against: 681Team informationChairmanSteve O'ConnorHead CoachDenis BettsCaptainKevin BrownStadiumHalton StadiumTop scorersTriesKevin Brown - 20GoalsJack Owens - 46PointsJack Owens - 128 ← 2014 List of seasons 2016 → This article details the Widnes Vikings rugby league footbal...

 

 

Open cluster in the constellation Crux NGC 4103Observation data (J2000 epoch)Right ascension12h 00m 39s[1]Declination−61° 55′ 00″[1]Distance5,320 ly (1,632 pc[2])Apparent magnitude (V)7.4 [1]Apparent dimensions (V)12'[3]Physical characteristicsMass1,180[4] M☉Estimated age25 million years[2]Other designationsCollinder 252, Melotte 109AssociationsConstellationCruxSee also: Open c...