how to record path in well format and easy to read?

meInvent bbird jobmattcon at gmail.com
Sun Jun 12 01:19:09 EDT 2016


i forget why i do combination of 2 operators
now i change not to use combination of 2 operators

https://gist.github.com/hoyeunglee/58df4c41a63a2f37e153cbdbc03c16bf


i run 
mresult = DFS(b, 2, 2, mylist, path) 

it do not have deep 2 and deep 1 in the path

they only separated in the list

however, i had already assigned in this format path.append([caseA,path2])
before return path, 

what's wrong with it?


On Sunday, June 12, 2016 at 12:55:17 PM UTC+8, meInvent bbird wrote:
> https://gist.github.com/hoyeunglee/350ac2dd496f7c1c95a428f847e6f2b1
> 
> then can not run deep 3 in python sagecloud
> 
> >>> mresult = DFS(b, 3, 3, mylist, path)
> ('deep=', 3)
> ({'11': 1, '10': 1, '00': 0, '01': 1}, {'11': 1, '10': 0, '00': 0, '01': 0})
> ({'11': 1, '10': 1, '00': 0, '01': 1}, {'11': 1, '10': 0, '00': 1, '01': 1})
> ({'11': 1, '10': 0, '00': 0, '01': 0}, {'11': 1, '10': 0, '00': 1, '01': 1})
> initlist=
> 18
> path=
> 18
> here is caseA
> ('deep=', 2)
> ({'11': 1, '10': 1, '00': 0, '01': 1}, {'11': 1, '10': 0, '00': 0, '01': 0})
> )
> ...     retu({'11': 1, '10': 1, '00': 0, '01': 1}, {'11': 1, '10': 0, '00': 1, '01': 1})
> ({'11': 1, '10': 0, '00': 0, '01': 0}, {'11': 1, '10': 0, '00': 1, '01': 1})
> initlist=
> 790
> path=
> 936
> ('deep=', 1)
> ({'11': 1, '10': 1, '00': 0, '01': 1}, {'11': 1, '10': 0, '00': 0, '01': 0})
> ({'11': 1, '10': 1, '00': 0, '01': 1}, {'11': 1, '10': 0, '00': 1, '01': 1})
> ({'11': 1, '10': 0, '00': 0, '01': 0}, {'11': 1, '10': 0, '00': 1, '01': 1})
> initlist=
> 1549682
> path=
> 1870866
> Killed
> 
> 
> On Sunday, June 12, 2016 at 9:38:51 AM UTC+8, meInvent bbird wrote:
> > https://gist.github.com/hoyeunglee/3fea29ed4aadb5dbc11c41f9a36070dc
> > 
> > i discover my code can not record the path
> > 
> > because i do recursive call at the end of function
> > however, i want to do full combination at the end of function before calling
> > recursive call, 
> > 
> > for seeing the result path, choose call recursive call in each else statement 
> > which means when it is not found yet, it will continue recursive call
> > 
> > this time, i use binary for simple case, 
> > 
> > but final result show only 4 records, first two do not have ok, 
> > 
> > third and fourth can not see ok, it become [...]
> > 
> > how to show this [...] ?
> > 
> > is there any method to record the path in well format and easy to read ?
> > 
> > because in 3 valued case, i do not know name of operators, i can only record the full column




More information about the Python-list mailing list