Prince Ludwig's father is Prince Luitpold of Bavaria. Prince Luitpold's ancestor Prince Luitpold of Bavaria (1821-1912) was the Prince Regent of Bavaria from 1886 to 1912.
Yes, you are correct
1. Luitpold Karl Joseph Wilhelm Ludwig, Prince Regent of Bavaria (12 March 1821 – 12 December 1912), was the de facto ruler of Bavaria from 1886 to 1912, due to the incapacity of his nephews, King Ludwig II for three days and King Otto for 26 years. Luitpold was born in Würzburg, the third son of King Ludwig I of Bavaria and his wife, Therese of Saxe-Hildburghausen. He was the younger brother of King Maximilian II of Bavaria and of King Otto of Greece. Luitpold was in line to succeed to the throne of the Kingdom of Bavaria, and was also heir presumptive to the throne of Greece, since his brother Otto had no children. However, the Greek constitution required that Otto's heir should belong to the Greek Orthodox Church. Otto was deposed in 1862 and replaced by Prince William of Denmark, who became George I, King of the Hellenes. Otto died in 1867, leaving Luitpold and his descendants as representatives of Otto's claim. However, Luitpold never pursued that claim.On 10 June 1886, Luitpold's nephew King Ludwig II was declared mentally incompetent and Luitpold was named Regent. Luitpold's part is still controversial. Following Ludwig II's mysterious death a few days later, his brother Otto assumed the throne. However, Otto was likewise (or more so) mentally incapable of reigning; he had been under medical supervision since 1883. Accordingly, Luitpold continued to serve as regent. Prince Luitpold was even accused by some people of the murder of his nephew, but soon the decent and affable prince became one of Bavaria's most popular rulers. One of his first actions (on 1 August 1886) was to open several of the palaces of Ludwig II to the public. On 1 April 1844, in Florence, Luitpold married Archduchess Auguste Ferdinande of Austria, Princess of Tuscany, second daughter of Leopold II, Grand Duke of Tuscany. Luitpold and Auguste had four children
1.1. Ludwig III (Ludwig Luitpold Josef Maria Aloys Alfried)( 7 January 1845 – 18 October 1921) was the last King of Bavaria, reigning from 1913 to 1918. Initially he served in the Bavarian military as a lieutenant and going on to hold the rank of Oberleutnant during the Austro-Prussian War. He entered politics at the age of 18 becoming a member of the Bavarian Legislature and keen participant in politics, endorsing agricultural and voting reforms. Later in life he served as regent and de facto head of state from 1912 to 1913, ruling for his cousin, Otto. After the Bavarian parliament passed a law allowing him to do so, Ludwig deposed Otto and assumed the throne himself. He led Bavaria during World War I.In June 1867, Ludwig visited Vienna to attend the funeral of his cousin, Archduchess Mathilda of Austria (daughter of his father's sister Princess Hildegard of Bavaria). While there, Ludwig met Mathilde's eighteen-year-old step-cousin Maria Theresia, Archduchess of Austria-Este, the only daughter of the late Archduke Ferdinand Karl Viktor of Austria-Este (1821–1849) and his wife Archduchess Elisabeth Franziska of Austria (1831–1903), and they married on 20 February 1868 at St. Augustine's Church in Vienna.They had an extremely happy and devoted marriage which resulted in thirteen children:
1.1.5. Prince Franz of Bavaria (German: Franz Maria Luitpold Prinz von Bayern) (10 October 1875 – 25 January 1957) was a member of the Bavarian Royal House of Wittelsbach and a Major General in the Bavarian Army.He was the fifth child and third son of King Ludwig III of Bavaria and his wife Archduchess Maria Theresia of Austria-Este. On 12 July 1912 Prince Franz married Princess Isabella Antonie of Croÿ, the daughter of Duke Karl Alfred of Croÿ and Princess Ludmilla of Arenberg. The wedding took place at the Schloss Weilburg in Baden near Vienna, Austria-Hungary. The couple had six children
126.96.36.199. Prince Ludwig of Bavaria (22 June 1913 – 17 October 2008) was a member of the Bavarian Royal House of Wittelsbach.He was the eldest son of Prince Franz of Bavaria, and his wife Princess Isabella Antonie of Croÿ.On 19 July 1950, Ludwig married his first cousin Princess Irmingard of Bavaria (29 May 1923 in Berchtesgaden – 23 October 2010 in Leutstetten), daughter of Crown Prince Rupprecht of Bavaria and Princess Antonia of Luxembourg. The civil wedding took place at Leutstetten, and the religious ceremony followed a day later at Schloss Nymphenburg in Munich. The couple had three children
188.8.131.52.1. Prince Luitpold of Bavaria (German: Luitpold Prinz von Bayern; born 14 April 1951) is a member and second in line of succession to the headship of the House of Wittelsbach, which reigned as kings of Bavaria until 1918 He is the oldest and only surviving child of Prince Ludwig of Bavaria (1913–2008) and his wife Princess Irmingard of Bavaria (1923–2010).On 25 June 1979, Prince Luitpold married Katrin Beatrix Wiegand (born 19 September 1951 in Munich), daughter of Gerd Wiegand (1922 in Cottbus – 1994 in Munich), architect, and first wife Ellen Schumacher, who married secondly Frauke Sinjen (1940/41 – 4 July 2003), actress. The civil wedding took place at Starnberg and the religious ceremony followed a day later at the Andechs Abbey in Bavaria. Initially the union was considered morganatic, but on 3 March 1999, the marriage was declared to be dynastic on the condition their children contracted dynastic marriages The couple had five children
184.108.40.206.1.3. Prince Ludwig Heinrich of Bavaria (born 14 June 1982 )In August 2022, his engagement to Sophie-Alexandra Evekink, a dual Dutch/Canadian citizen and doctoral student at the Law Faculty of the University of Oxford, was announced.
I just noticed in Wikipedia the comment about the marriage of Prince Luitpold and Karin Wiegand:
".... Initially the union was considered morganatic, but on 3 March 1999, the marriage was declared to be dynastic on the condition their children contracted dynastic marriages..."
As far as I can see their 5 children did not have dynastic marriages. And to my knowledge this is also the case for Ludwig.
Would Ludwig still considered to be a heir to his cousins the current head and the heir-presumptive of the Royal House of Bavaria, Duke Franz and his younger brother Max. Both have no male offspring.