This is problem of optimization.
I want to create bipartite graph with weighted edge..
So i have created program.
Please tell me how can i add weight to each of its edges and then from this i can calculate min. objective function.

import java.io.*;

class bip
{
String str = new String();
int set1[],set2[],ss1[],ss2[],e[][],w[][];
int obj_func,x,y,count,z;

public void create_set()
{
//System.out.println("Enter the no. of members in set-1:");
try
{
System.out.println("Enter the no.of members in set-1: ");
System.out.println("Enter the no. of members in set-2: ");
set1 = new int[n1];
set2 = new int[n2];
for(i=0;i<n1;i++)
{
set1[i] = i;
}
k=i;
for(j=0;j<n2;i++,j++)
{
set2[j] = i;
}
l=j;
}
catch(Exception e1)
{
System.out.println("Raised:"+e1);
}
}
void disp()
{
System.out.println("Members are in set-1 : ");
for(i=0;i<n1;i++)
{
System.out.print(set1[i]+", ");
}
System.out.println("Members are in set-2 : ");
for(j=0;j<n2;j++)
{
System.out.print(set2[j]+", ");
}
}
{
try{
System.out.println("Enter no. of links between nodes: ");
{
System.out.println("Enter the two members no. between u want link:");
}}
catch(Exception e2){System.out.println("Raised:"+e2);}
}
void is_bipartite()
{
x=1;
count=0;
{
for(i=0;i<k;i++)
{
for(j=0;j<l;j++)
{
if((ss1[x]==set1[i]) && (ss2[x]==set2[j]))// || ((nn2[x]==nodelist1[i]) && (nn1[x]!=nodelist2[j])))
{
//cout<<"this graph is bipartite in nodelist1"<<endl;
count++;
}
else if((ss1[x]==set2[j]) && (ss2[x]==set1[i]))// || ((nn2[x]==nodelist2[j]) && (nn1[x]!=nodelist1[i])))
{
//cout<<"this graph is bipartite in nodelist2"<<endl;
count++;
}
else
{
//	cout<<"not bipartite"<<endl;
}
}
}
x++;
}
}
public static void main(String args[])
{
bip b1=new bip();
b1.create_set();
b1.disp();