Saturday, May 10, 2014

Day 31 : Final Algorithms.

Done.
This one sweet word explains the abrupt absence from documentation. To elaborate, I can say that I have the final algorithms designed, AND implemented.
The officially look like

 and
Now, I am running simulations, and collecting results, and writing report.
I'll be back soon with some sample results. So Long. 

Tuesday, April 22, 2014

Day 30 : cost function - design edit.

I realise now that my design for the cost function was incomplete.
A "cost" should be something with an inherent negativeness to it, this was missing. So, the design edit is, while the company shifts it's clusters, this should be known as "effort" on part of the company, and this effort should have a related "cost", which is directly relational with the amount of effort on the part of the company.

This would allow better simulation of the different "levels of user-involvement" as well as let us monitor effectiveness of different strategies in the long run.
I should implement these changes, and come back with more pretty graphics soon. So Long.

Sunday, April 20, 2014

Day 29 : Cost functions and Spatial clusters : first look.

Finally, A first look at the spatial presentation of the clusters.

The colormap was a bit tricky, but finally it worked, and now the agents change colors as they move towards the cluster centres, in small steps. Also, the cost function makes sure that the cluster centres themselves move toward the agents in even smaller steps.

The function to measure spread as a function of time will need some tweaking due to the recent modifications, and that should take up the better part of the next week.
So Long.

Wednesday, April 16, 2014

Day 28 : Cleanup!

So, some much needed code cleanup was overdue.
Finally, the belief is a function of number of connections of the agent, and normalised between 0 and 1. A quite easy, but crucial modification to the previous model. The new threshold is set at 0.025 , for no special reason.
Also, implemented the changes in x-y coordinates, and made the shift fractional, to make it more realistic.

After all these changes, the results for 10,000 agents, over 100,000 iterations look as

Exponential fit for color1 spread
 Exponential fit for color 50 spread
 2-D Spatial Cluster( with fractional shift)
Interestingly, now c1 and c50 both start at a similar volume (248 and 258 respectively), but still the trend remains same.
Now that the mod is done, I will carry on and implement the cost function. So Long.

Sunday, April 13, 2014

Day 28 : competing trends!

Since last update, I have been working on a simulation to show how competing trends would spread and often replace each-other among the population.

With a few assumptions, I get the following results.

  1.  Let 2 colors (competing with each other for the same attribute) diffuse in the network. (I picked color 1 and color 50) 
  2.  Give color 1 a head start (500 timestamps, then color 50 also starts to diffuse, for total of 10,000 time steps) 
  3. Track the diffusion for both.
This algorithm results in the following output 


We can see here that c1 takes a lead over c50, and they both exhibit exponential nature of change.
Next step, I will introduce a cost function for the change, and see what happens. So Long.

Friday, April 4, 2014

Day 27 : Tracking!

Finally, now the whole simulation works as follows:

  1. ​Assign different color (between 1 to 50) uniformly to all agents.
  2. Randomly pick 1 color track.
  3. Let that color diffuse in the network, and track it's progress as follows :
    1. ​t = time step, v = volume, i.e., number of members in that cluster. we keep track of [t, v]
    2. we plot t vs. v in the end.
    3. There are two modes of diffusion. They are :
      1. ​Free diffusion. In this case, if the edge is selected, diffusion takes place.
      2. Constrained diffusion. In this case, diffusion only happens if the distance in "trust" or "belief" attribute of both nodes is less than 2 (belief value varies from 1 to 5).
The output for Free diffusion looks like this.
And the output for constrained diffusion looks like
The significant reduction in the number of conversion in case of constrained diffusion is clear, however, both cases exhibit the nature of an exponential growth, which is interesting. 
I shall play with this new model in more detail over the weekend. So Long.


Wednesday, April 2, 2014

Day 26 : Attribute clusters and trust values.

So the next step was to assign attributes 'color' and 'trust' to each node. The 'color' attribute ranges from 1 to 50 , while 'trust' ranges between 0 and 1.
And for n-iterations, randomly pick a each edge, and based on the difference between their 'belief' attributes, the 'color' attribute of one vertex node influences the attribute of the other vertex.

The result on 10,000 nodes, wit 4 average connections each,  over 100,00 iteration are shown below.

The first figure is for model 1, where left side sows the initial clustering, and right shows the final clusters.

And for model 2, it looks like

The same graphs, if the "trust" property is not used, would respectively look as



and


Next, I am working on more simulations, and generalising the "trust" attribute to be a composite of different attributes.
So Long.