-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmin.py
More file actions
33 lines (29 loc) · 746 Bytes
/
dmin.py
File metadata and controls
33 lines (29 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 18 14:11:20 2022
@author: asus
"""
import numpy as np
import math
from cyclo import*
import itertools
##################################################################################
def dmin(d, n):
D=cyclo(n)
G=[]
for i in range(1,d):
for j in range(len(D)):
if i in D[j]:
G.append(D[j])
break
else:
continue
G.sort()
z=list(G for G,_ in itertools.groupby(G))
a={tuple(x) for x in D}
b={tuple(x) for x in z}
u=a.difference(b)
h=[list(tup) for tup in u]
v=[item for sublist in z for item in sublist]
g=sorted(v)
return(h, g)