I came across an excellent solution provided by user Ignasi for drawing Karnaugh maps in LaTeX. The original code can be found here.
I need to modify this code to support edge grouping for an 8-cell Karnaugh map, like this:
I've tried a few modifications, but I'm facing difficulties in achieving the desired result. I tried using karnaugh-map package but it keep grouping in cell 5 and 7 which should not happen here.
\documentclass[tikz, border=2mm]{standalone}
\usepackage{karnaugh-map}
\begin{document}
\begin{karnaugh-map}[4][2][1][$X_1X_0$][$X_2$]
\minterms{4,6}
\maxterms{0,2,3,7}
\indeterminants{1,5}
\implicant{4}{6}
\end{karnaugh-map}
\end{document}
Could someone help me adapt the existing code for edge grouping in an 8-cell Karnaugh map? Any insights, suggestions, or modified code snippets would be greatly appreciated.

