Wednesday, May 28, 2008

Sudoku

Blogging after a long time, much due to lack of interest and a bit of time factor as these six months were the most happening months of the engineering life. Much has happened that is worth noticeable but that would merit a separate post.

Today my interest is SuDoKu - A long time passion for me.I have been developing a cpp code that would generate and solve a variety of types of SuDoKu problems in a fast and efficient way.I succeeded in developing a code that would satisfy my requirement a long time ago.i.e 3-4 months back. But now I am more interested in improving the code and its response time in case of solvers.

Interestingly, during any operation in SuDoKu one needs to check the validity of the number to be input at the given place in the 9X9 grid. This check involves checking 9 blocks for row,column and 3X3 block respectively. This would require 27 iterations for each check! This was the major time consuming part of the code. I started using different methods for decreasing the response time.

As I was using guessing along with logical analysis, solution time was never going to be constant.
So in order to obtain mean solution time, I devised a function to run the code on a standard problem 10,000 times and then take the mean. As for the need for reduction of the iterations, I used indexing of the positions in the SuDoKu grid. When any number is entered at any position it would trigger a flag index that contains information for a particular number at a particular position. This brought the number of iterations from 27 to just 3! But it cost 3 times as much memory. But from the context of overall memory requirement of program, it was drop in the ocean.

So I started chasing the fastest solution time with (+/-)5% error. Now I am proud to have succeeded in developing a code that solves the Hardest SuDoKu Puzzle. Now for an average sudoku puzzle it gives mean solution time of 9 millisecond on a P4-2.88 G Hz machine. Other factors other than that of processor speed may affect the time but that would be within 5% error range. So I feel pretty satisfied with my achievement.

You can get the source code here.

Most of the goals about SuDoKu other than cross platform compatibility(much due to lack of interest in learning new graphics library) have been fulfilled. So now it is full-stop to SuDoKu and I am all geared up for a new challenge. After all, only goal is to Excel!

Friday, January 11, 2008

Ponting.. you lost my faith

Late.Too late, as one might say. But right from the first day of the controversy, I decided to just stay put and absorb the proceedings.And now that everything seems to have settled, I want to put my say on the records with the help whatever information that has been given out by the news agencies and the articles of many 'experts'.

I am not a 'pure I hate Ponting' man. I was and am a great fan of Ponting's 'BATTING'. Yes, only batting as, now I don't consider Ponting as a great 'PLAYER'.Why? let's consider the reasons.

First of all, I don't blame him for the result of the match. Lets go case by case. First one, he stood on the pitch after being given out,'wrongly', even after he was given 'life' by same umpire. I don't blame him for this.

Second case:the Harbhajan issue. This is really a serious issue. I think by now, we know enough about this controversy. We know about the 'pact '. If Symonds had given his word to harbhajan on sledging, why should he turn back on it. His answer is dubious. He rushed to help his team mate when being patted on the back by harbhajan. But his 'team-mate ' had no problems with that. Only Symonds did. Now incomes Ponting who is aware of this whole thing and tells Harbhajan that this was second time he has called the 'Monkey' word, believing that he did. We know that Kumble wanted to resolve the matter between players, as he said, seeing the after-effects of such a thing. But Ponting had reported him already. What a strong leader.So quick to back his players. Appreciated. Now I want to say something.

Do the Australians think that they will keep saying anything ,i.e. sledging, and everybody will listen to it. Someone like Harbhan is bound to give it back. This angers them. What is it? Only word is Arrogance. Some people say that Indians are no saints. But in sledging,they are. Not because they are so gentlemen, but for the communication problem. You can try the young ones in Hindi....


But back to point. Ponting did report the incident despite obvious breaking of the pact and provocation.


And all this considering that Harbhajan did say something like that. But on the flip side,SACHIN TENDULKAR says that he did not hear anything like 'monkey' at all. This comes from a man who in any sense is a true gentleman of the game. If one thinks otherwise, he should not read further. So all comes to same point. Reporting Harbhajan was most unsportsmanlike behavior given that his team dishes out many unwritable comments during the match being termed as sledging.


During the hearing word of Sachin was not taken as a proof. One might say similar to Atrocity Act in India word of the accusers is considered as major proof. But this is not Indian act dealing, this is ICC hearing, and all the sides should be given to have a fair say.Here Ponting has no blame, but he is culprit of 'reporting' in the first place.


Third issue: Ponting pretended to take a catch. It was not a catch in the first place.Ponting made it a catch with his outstanding fielding skills.But that does not mean you can claim a non catch. In any other circumstances this would have been acceptable as everybody does the same,and he is no different. But this is a special case because of the very reason that 'he made a pact with Anil Kumble on decision of catches'. He himself broke the pact by appealing on a non-catch. Don't tell me he did not sense it.In any catch fielder does know whether he has taken it or not. I myself am not a brilliant fielder but ask any good fielder, he will tell you the same. Yes he disclaimed a catch before it the other day. But then his team was not in 'threat' of draw.On the last day he really did go mad for victory. And did some shameful things.Yes that decision was given not out.But if umpires would have used the 'pact' and had asked Poning whether it was out,which is what I think he anticipated, Dhoni was a goner. But better sense prevailed for some time and they asked the third umpire.


Fourth case:

I don't consider him to be blamed in Ganguly catch. He believed in his team-mate's words and said it was out.But again what a leader who doesn't have control on his team?It is more than clear that Clark DID LIE. Which means that he lied to his leader if we consider Ponting to be innocent in this case. This is more shameful than anything else. Hence, I presume,that Ponting knew that it was not out. How sportsman-like!

Last but not the least, they just did not seem to be bothered about shaking hands with the Indian players.But it is just madness to expect the Australians to behave them self. Celebrate, you should, but properly. Again sportsmanship comes into picture.


Least of all, after the match he should have apologized for the breaking of the 'pact'. This to me was most 'Unsportsmanlike'.

The comments of the members of the Hall of Fame say it all. If even the greats consider him and his team as unsportsmanlike, need I say more?


All in all, he will always be great batsman. But,as the great Neil Harvey said before this incident, he is not even a TENDULKAR let alone BRADMAN'. MR. Ponting, please try to be a great 'player'.

Saturday, January 5, 2008

HELLO SKIES!

It was an eventful week indeed. First I went to a good trip to Raigad and Janjira forts and enjoyed the last days of last year in Mighty presence of Fort Raigad, also enjoying a bit of adventure in the form of 'Journey To The Base of Raigad' in pitch dark, and only a mobile back-light to assist. As soon as I welcomed 'The New Year' late in the mourning, I received shock in the form of a news that said the results were due any time that day. I just wondered how cruel life can get.....why should the very first day of new year be marked as the worst day in next six months?(results were going to be out you see..). But yet again goodness prevailed and stopped the year from being started on bad note, 'the news' was just another rumor after all. Bless me,how relieved I was!

Anyways sooner or later the results were bound to come, and come they did. Eventually it was O.K. got 67%. At least distinction at last. So the year had started with a 'not bad' note on its head.

Now it was time to just relax a bit(which I was going to do anyways..),and enjoy cricket both on and off the field. Just then I got the news(this time a confirmed one) that Gaganvedhi
group, associated with astronomy and astrophysics, in our college of which I also happen to be a member on a post(which one I don't know..),had organized a sky-watch. Well, they couldn't have chosen a better time for it. I just wanted to get out the practical world and just watch things happen, for which, for a change, I was not going to be held responsible. Just watch the stars, group of stars, their interesting patterns, various subtleties of positions and formations of them, and enjoy some furious debates on ever debatables like 'the Bermuda triangle' etc.

In some chilling cold I enjoyed better part of this star gazing, but some time in the night the cold got better off me and I just changed the focus from skies to mother earth. An enjoyable stint with wood-fire with the watchman,raised the spirits once again. Again I was up and wondering, to see the Jupiter on the horizon and to see how do the trenches on moon actually look from a telescope. Just bless the great Gallilio, but for him, would anyone have seen the distant stars that make some meaning?

I just know one thing, the world is too big to fit into at least my imagination. Just got one damn clear message from deep inside me,'Boy, just live your life in the happiest possible manner.Don't dare to care about the rest. Lad, it ain't that small....'

Tuesday, January 1, 2008

hello world

THose who have learnt the C language from LET US C,i think,would remember the first prgrame is always 'HELLO WORLD'. I see the same connection here also. This is my first post, and i think this also start the way C did..'HELLO WORLD'.

I always wanted to express myself but there was no medium and when blogs started, i did not have an internet connection for it.But now i have it and i am thinking to make most of it.

I was inclined to think that title of the first post should be 'well began is half done',but as you see this is somethink that is never done,so lets never be 'Done' with it..

Aniket.