Connect it for what? You could use 2 patch cables and a switch, a cross-over cable, firewire, you could connect wirelessly over a network, you could connect over a lan on a network. You could tie the two computers together with a rope or use super sticky glue. I'm not sure what you are asking.
Two computers
a cord
The simplest kind of home network contains exactly two computers. You can use this kind of network to share files, a printer or another peripheral device, and even an Internet connection. To connect two computers for sharing these and other network resources, consider the options described below The traditional method to network two computers involves making a dedicated link by plugging one cable into the two systems. Several alternatives exist for networking two computers in this manner:
You can buy a firewire cord. That is the fastest and easiest way to connect two computers.
wireless
An HDMI cable is not designed to connect two computers together.
Cross cable.
linksys
yes
You can connect them with an ethernet cable, or by WiFi if they have wireless cards.
Buy a lan router, they can be used with lan cable or wireless to connect all your computers through a network. If there are only two computers that you wish to connect then you only need on lan cable which you connect in the back of each of those two computers to create a network.
I believe that it is possible to connect to computers to one monitor. I have worked with brand new LCD monitors with two inputs - one DVI and one VGA. The monitor auto-senses which port is being used. So in theory, use the auto detect button on the front of the LCD panel to switch between computers.