I have a large CELL of the order 18000×4 (Or a MATRIX of the similar order) Each CELL element is a 'name' and therefore a string (In case of Matrix it is a 'number') The operation I need to do is explained in the following example (Please find relevant files attached). Example:
CELL INPUT'1' '3' '4' []'1' '3' '5' []'1' '3' '6' []'1' '4' '4' []'1' '4' '5' []'1' '4' '6' []'2' '3' '4' []'2' '3' '5' []'2' '3' '6' []'2' '4' '4' []'2' '4' '5' []'2' '4' '6' []'5' '4' [] []'5' '7' [] []'6' '8' '4' []'6' '8' '7' []'9' '10' [] []CELL OUTPUT'1' '4' [] []'1' '3' '5' []'1' '3' '6' []'2' '4' [] []'2' '3' '5' []'2' '3' '6' []'4' '5' [] []'5' '7' [] []'4' '6' '8' []'6' '7' '8' []'10' '9' [] []
There are 2 main operations done to get the output:
1) Delete the duplicates in the rows. (1 4 4) —> (1 4) and (2 4 4) —> (2 4) in the above example.
2) After step (1), compare every row and delete the supersets of the row if any. (1 3 4) (1 4 5) (1 4 6) deleted because they are supersets of (1 4). Similarly, (2 3 4) (2 4 5) (2 4 6) are deleted because they are supersets of (2 4)
I have written a MATLAB function called 'minimize' which does this operation. But, when I need to do this for a large CELL of order 8656×4, MATLAB keeps running and there is no solution after 48hours. I need to get this done for even larger orders of the CELL and within a time frame of 1-2 hours.
Could you please provide any method/suggestion to efficiently solve this?
Best Answer