Wireless sensor network in practical for beginner
Which type of sensor can achieve the capabilities: organizing network
topology, implementing router protocol, etc.

A wireless sensor node usually consists of 3 parts.

A sensor
A radio
A processor (which in some cases is included on the same chip as the radio).

Routing and handling of network traffic is typically performed by the processor.

For just handling network traffic, just about any 8-bit MCU (Like PIC, AVR, or HCS08) would work and would be relatively simple to get up and running.  They typically cost under $5.


How to code these sensors to obey my scheme? Should I have a Raspberry
Pi?

A Raspberry Pi would work but its overkill.  Unless you are processing video or radar/sonar data you won't need that much processing power.  The drawbacks to using it are that its going to be bigger, more expensive, and consume more power than just using a single chip 8-bit MCU.
There are also various 32-bit MCUs out there that could work (like ARM, PIC32, AT32UC3L), but configuring them is likely to be much more complex, and they will burn more power (which is a consideration if the nodes are battery powered).

I am skilled in C/C++, Python. It's enough to build my WSN from
scratch?

Of those three languages, &quot;C&quot; is probably the most appropriate choice to use on a small 8-bit MCU.  You might also use C++ if the compiler supports it, but the use of object oriented programming often leads to slower performance on small systems like this.
With firm knowledge of &quot;C&quot; you can build a network.

Doing the RF design from scratch is probably too advanced for a beginner, so I would recommend using an off the shelf RF module.

Many off the shelf modules implement their own network protocols.  The intention of the manufacturer is to make something that people can just plug together and get working.  But that's not really suitable when one's goal is to test their own custom network protocols (as you seem to be doing).

For your wireless radios I would recommend the MRF24J40MA or MRF24J40MD sold by Microchip corporation.  I have had good luck with them.  They transmit raw 802.15.4 physical layer packets, and you have total control of what goes in the packets and when they transmit.  The range is either 400feet or 4000 feet depending on which module you get.  The interface is a 4 wire SPI bus.  In sleep mode they only consume a few uA, so they can be used in low power systems.

You may also consider some of the wireless modules made by Nordic Semiconductor.  Some of those offer both the radio and micro-controller in one chip, which can lead to a smaller and more integrated solution.